0

私のプロジェクトでは、1 つの ComboBox での選択が、次の ComboBox で使用可能なオプションに影響します... 私はこれにかなり慣れていませんが、私が正しければ、すべての文字列が actionListener 内の if/else ステートメントとして表示されます。 . これを抑える方法はありますか、それとも、指の関節を鳴らしてタイピングするだけの時間ですか (まったく同じ文字列を持つ 2 つのモデルが表示された場合、それは個々の文字列がまだすべて追加されていないためです)?

//Model Dropdown
final DefaultComboBoxModel termModel = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Hypercom", "DejaVoo", "Nurit", "Verifone"});

//Default Dropdown
final DefaultComboBoxModel slctAbove = new DefaultComboBoxModel(new String[]{"Select Option Above"});


//Terminal Dropdowns
final DefaultComboBoxModel hSpecModel = new DefaultComboBoxModel(new String[]{
        "Choose One...", "T7Plus", "4205", "4210", "4220", "4230"});
final DefaultComboBoxModel dSpecModel = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Dial", "IP", "Wireless"});
final DefaultComboBoxModel nSpecModel = new DefaultComboBoxModel(new String[]{
        "Choose One...", "2085", "3020", "8320 Dial", "8320 IP", "8400 Dial", "8400 IP"});
final DefaultComboBoxModel vSpecModel = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Global Dial", "Global IP", "TPS Dial", "TPS IP", "Ptech Dial", "Ptech IP"});

//Call Type Dropdown
final DefaultComboBoxModel callReason = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Download", "Troubleshoot"});

//Error Dropdowns
//Hypercom
final DefaultComboBoxModel hypError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Printer Error", "Retry Batch Trans", "AP Dupe", "Invalid Balance Settlement"});

//DejaVoo
final DefaultComboBoxModel dejaError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid Batch #", "AP Dupe"});
final DefaultComboBoxModel dejaMError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid Batch #", "Transport Layer Abort", "AP Dupe"});

//Nurit
final DefaultComboBoxModel nuritDError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid DUKPT Key", "Invalid Balance Settlement", "AP Dupe", "Secure Capture", "Invalid Term ID", "Open Tab", "No Host Response"});
final DefaultComboBoxModel nuritIpError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid DUKPT Key", "Invalid Balance Settlement", "AP Dupe", "Secure Capture", "Invalid Term ID", "Open Tab", "No Host Response"});
final DefaultComboBoxModel nuritWError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid DUKPT Key", "Invalid Balance Settlement", "AP Dupe", "Secure Capture", "Invalid Term ID", "Open Tab", "No Host Response", "Rad Fail", "No Net"});

//Verifone
final DefaultComboBoxModel verifError = new DefaultComboBoxModel(new String[]{
        "Choose One...", "Invalid Merch ID", "Invalid DUKPT Key", "Invalid Balance Settlement", "AP Dupe", "Keyboard Locked", "Invalid Term ID", "Card Not Supported", "Comm Error"});
4

0 に答える 0