Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

Problem in using arrow keys with JComboBox

Thread view: 
jude - 12 Jan 2004 07:25 GMT
Hello,

   In a dialog box i am using JComboBoxes .In left side ComboBox in
the drop
down list i can use arrow keys . But in the right side ComboBox in the
drop list
arrow keys are not working .. Any idea what should be the problem .

The following is the code i have used .

Regards,
jude

try {
            ivjagreementInitiatorComboBox = new JComboBox();
            ivjagreementInitiatorComboBox.setName("agreementInitiatorField");
            ivjagreementInitiatorComboBox.setPreferredSize(new
Dimension(150, 20));
            ivjagreementInitiatorComboBox.setMaximumSize(new Dimension(6000,
20));
           
            ivjagreementInitiatorComboBox.setAlignmentX(LEFT_ALIGNMENT);
           ivjagreementInitiatorComboBox.setEnabled(true);
               
           
           
            for (int i = 0; i < agreementupdateStrings.length; i++) {
                            ivjagreementInitiatorComboBox.addItem(agreementupdateStrings[i]);
                        }
            ivjagreementInitiatorComboBox.setToolTipText("Initiator of the
replication agreement.");
            ivjagreementInitiatorComboBox.setRequestFocusEnabled(true);
        //    ivjagreementInitiatorComboBox.setAlignmentX(LEFT_ALIGNMENT);
           
       
        } catch (java.lang.Throwable ivjExc) {
            handleException(ivjExc);
hiwa - 12 Jan 2004 11:18 GMT
> Hello,
>
[quoted text clipped - 33 lines]
>         } catch (java.lang.Throwable ivjExc) {
>             handleException(ivjExc);

Q1: Is this left side or right side?
Q2: Could you show the code for another JComboBox?
Q3: Is validate() called in your container?
   (after xxxSize() methods are called on the component)
jude - 14 Jan 2004 06:20 GMT
Hello,

 I am not using  Is validate()  is my container
 It is right side of the container .. ( -> )

 The another ComboBox code is ..

if (ivjknowledgeTypeComboBox == null) {
        try {
            ivjknowledgeTypeComboBox = new JComboBox();
            ivjknowledgeTypeComboBox.setName("knowledgeTypeField");
            ivjknowledgeTypeComboBox.setPreferredSize(new Dimension(150, 20));
            ivjknowledgeTypeComboBox.setMaximumSize(new Dimension(6000, 20));
            ivjknowledgeTypeComboBox.setEnabled(true);
            ivjknowledgeTypeComboBox.setToolTipText("Type of references to
naming contexts to be shadowed.");
            ivjknowledgeTypeComboBox.setRequestFocusEnabled(true);
            for (int i = 0; i <
ReplicationDetails.shadowKnowledgeTypeStrings.length; i++) {
               ivjknowledgeTypeComboBox.addItem(ReplicationDetails.shadowKnowledgeTypeStrings[i]);
            }
        } catch (java.lang.Throwable ivjExc) {
            handleException(ivjExc);
        }
    }
    return ivjknowledgeTypeComboBox;
}

Regards,
jude

> > Hello,
> >
[quoted text clipped - 38 lines]
> Q3: Is validate() called in your container?
>     (after xxxSize() methods are called on the component)
Andrew Thompson - 14 Jan 2004 11:54 GMT
....
|   The another ComboBox code is ..

http://www.physci.org/codes/sscce.jsp
We need self contained code, not just
snippets, jude.
Andrew Thompson - 12 Jan 2004 12:33 GMT
..
|     In a dialog box i am using JComboBoxes .In left side ComboBox in
| the drop
| down list i can use arrow keys . But in the right side ComboBox in the
| drop list
| arrow keys are not working .. Any idea what should be the problem .

What do you mean when you say
'left' and 'right' JComboBox?
Only one is ever instantiated.

But then, it's a bit hard to tell what you
are doing without an SSCCE..
http://www.physci.org/codes/sscce.jsp

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.