Results 1 to 5 of 5

Thread: How to use JComboBox.AccessibleJComboBox class?

  1. #1
    Join Date
    Dec 2009
    Posts
    68

    How to use JComboBox.AccessibleJComboBox class?

    Hello Guys,

    I am studying java programming from two months. But I am not getting what is the functionality of 'JComboBox.AccessibleJComboBox class' of java. I want to know about it's methods also. I have referred various java book for this claas, but nothing was helpful. Do you have knowledge about 'JComboBox.AccessibleJComboBox class' of java? If yes then please let know the same. I am waiting for your reply.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: How to use JComboBox.AccessibleJComboBox class?

    Hi,

    A JComboBox.AccessibleJComboBox class implements accessibility support for the JComboBox class. It provides an implementation of the Java Accessibility API appropriate to Combo Box user-interface elements. The 'JComboBox.AccessibleJComboBox class' implements AccessibleAction, AccessibleComponent, AccessibleExtendedComponent, AccessibleSelection, Serializable interfaces.

  3. #3
    Join Date
    Apr 2008
    Posts
    1,948

    Re: How to use JComboBox.AccessibleJComboBox class?

    Following java example will demonstrate you the use of JComboBox.AccessibleJComboBox class:
    Code:
    import javax.swing.JComboBox.AccessibleJComboBox
    import javax.swing.JFrame;
    
    public class JCAMain extends JFrame 
    {
      JComboBox combo01 = new JComboBox();
    
      public JCAMain() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
        combo01.addItem("A");
        combo01.addItem("H");
        combo01.addItem("P");
        combo01.setEditable(true);
        System.out.println("#items=" + combo01.getItemCount());
    
        combo01.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            System.out.println("Selected index=" + combo01.getSelectedIndex()
                + " Selected item=" + combo01.getSelectedItem());
          }
        });
    
        getContentPane().add(combo01);
        pack();
        setVisible(true);
      }
    
      public static void main(String arbg[]) {
        new JCAMain();
      }
    }

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Re: How to use JComboBox.AccessibleJComboBox class?

    Hi friend,

    To use 'JComboBox.AccessibleJComboBox class', before that you need to be aware following it's methods:
    • removeAccessibleSelection(int iz)
    • isAccessibleChildSelected(int iz)
    • getAccessibleSelection(int iz)
    • getAccessibleChild(int iz)
    • getAccessibleActionDescription(int iz)

  5. #5
    Join Date
    Apr 2008
    Posts
    2,005

    Re: How to use JComboBox.AccessibleJComboBox class?

    Hi,

    In following example I have used methods of 'JComboBox.AccessibleJComboBox class' for to add the new item to the JComboBox:
    Code:
    import javax.swing.JFrame;
    import javax.swing.JComboBox.AccessibleJComboBox;
    
    public class AddingItemToComboBoxDM {
    
      public static void main(String[] a) {
        JFrame zlp = new JFrame();
        zlp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
        JComboBox jComboBox01 = new JComboBox();
        jComboBox1.addItem("asdf");
        Object cmboitem1 = jComboBox01.getSelectedItem();
        System.out.println(cmboitem1);
    
        zlp.add(jComboBox1);
    
        zlp.setSize(200, 200);
        zlp.setVisible(true);
      }
    
    }

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. Use of JComboBox class
    By Bottlenecked in forum Software Development
    Replies: 5
    Last Post: 18-02-2010, 10:55 AM
  3. Replies: 5
    Last Post: 12-02-2010, 06:23 PM
  4. How to initialize a jcombobox ?
    By Ron1 in forum Software Development
    Replies: 3
    Last Post: 03-04-2009, 11:07 PM
  5. Good news for CBSE CLASS X & CLASS IX - visit learnnext
    By surya_expert in forum Education Career and Job Discussions
    Replies: 0
    Last Post: 13-12-2008, 12:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,151,027.79940 seconds with 16 queries