java Gui actionListener help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ooneguy
    New Member
    • May 2010
    • 1

    java Gui actionListener help

    I'm trying to write a java gui program that contains 3 different tabbed pane, 1 tabbed pane consists JComboBox. When i choice using JComboBox, the result will be shown because I using actionListener to create JComboBox result. What i want to do is when I choice JComboBox in one of tabbed pane, it would also show result in another tabbed pane as I have 3 tabbed pane in my program. I've been trying all the ways i know but i can't write it. Please help me out from this ... Thanks you very much .



    String [] quantity = {"0","1","2","3 ","4","5"};
    com1 = new JComboBox (quantity);
    com1.setSelecte dIndex(0);
    com1.addActionL istener(new listener());
    add (new JLabel ("choice"));
    add (com1);


    private class listener implements ActionListener

    {
    public void actionPerformed (ActionEvent event)
    {

    int totalIdx = com1.getSelecte dIndex();

    if (totalIdx >=0)
    label.setText(" Total : " + total3[totalIdx]);
Working...