jcombobox

How can I change the arrow style in a JComboBox

Let's say I want to use a custom image for the arrow in JComboBox, how can I do this? I understand it's possible using the synth xml files, or maybe even UIManager.put(...), but I don't know how. All I want to do at this time is change the arrow image to something else, either programatically or even just overriding the image it uses. ...

Java Swing: How to make the JComboxBox drop down list taller?

How to make the "dropdown" (or "popup", I don't know how it's called) of a JComboBox taller on the screen? By default, when I open my JComboBox I see, say, 7 out of 29 items, then I need to scroll. What should I do so that I can see, say, 15 out of these 32 items? (or if the dropdown is, say, 150 pixels tall, how can I make it 300 pixe...

JFrame not working correctly

This is making me very angry, I have worked on this for 2 days, have 2 books open and have looked through them, and STILL can't get this program to run the way I want it run. I'm getting to the point where if this doesn't help, I quit. I want a SIMPLE Frame application. It has a JComboBox centered at the top. Next to it is a text field...

Exception seems to kill updating of a JList

I'm using an ActionListener to update a JList whenever an item is selected. jComboBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JComboBox cb = (JComboBox) e.getSource(); updateLocalFileList( cb.getSelectedItem().toString() ); } }); It is calling this method for the UI...

How to trigger Java Swing InputVerifier on enter in JComboBox (actionPerformed)?

I have a Swing JComboBox with an InputVerifier set correctly. I am using the combo box to set an integer. If I type "cat" in the field and hit tab, my InputVerifier triggers and resets the value to "0". If I type "cat" and hit enter, my InputVerifier is never called from actionPerformed. Do I need to explicitly call my InputVerifier ...

JComboBox.addItem for null objects

HI, I have a JComboBox to which I'm adding my custom object items. But sometimes the object added are empty. So, when the comboBox has empty items in it, it collapses and becomes very thin. But once populated, becomes of noral height. Can somebody please suggest semething to keep the height of the JComboBox maintained even when no items...

How do I populate jcombobox from a textfile?

I would like to be able to populate a jcombobox from a textfile. I am using NetBeans 6.9. Any suggestions would be appreciated. Thanks. ...

Fast replacement for JComboBox / BasicComboBoxUI?

I've got a JComboBox that potentially can have thousands of items. They're sorted, and there's find-as-you-type, so in principle it's not completely unusable. In practice, it's pretty unusable with just a couple of hundred items. I managed to improve the initial display performance using setPrototypeDisplayValue(), but BasicListUI still...

Change the size of a scrollbar in JComboBox

Does anybody know how to change the scrollbar size in jComboBox manually? I've tried a whole bunch of stuff and nothing works. ...

JComboBox in a JTable cell

Hello... I have a JTable created using a model, which is based on a matrix of objects. For each row, I want to put in a specific column (the 5th) some information using a JComboBox. I have tried the following: for(int i=0; i < n ; i++) { ..... data[i][5] = new JComboBox(aux); // aux is a Vector of elements I wanna insert } ta...

Combo box custom renderer while enabling/disabling combo

I have 2 combo boxes, one dependent on another. For the second combo I define custom renderer and it's disabled. It should enable when some items of the 1st combo is selected, but it clears all values instead. The problem is that the values are set but are not rendered. In constructor: comboBoxes[1].setEnabled(false); comboBoxes[1].set...

custom JComboBox top label

Hopefully an easy question. From the example on http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/uiswing/components/combobox.html on "Providing a Custom Renderer" section, I can make a JComboBox like Picture 3 - Text 3 ------------------- Picture 1 - Text 1 Picture 2 - Text 2 Picture 3 - Text 3 Picture 4 - Text 4 Picture 5 ...

Retrieve text from JComboBox

How to retrieve Text that is typed in JComboBox. This text need not be an existing item. ...

jtable and custom combos

Hi, I want to implement a properties table in jtable (swing). I want to have e.g. ** 2 column table Row1: Property-text| Txtbox. Row2: Property-text| ComboBox of values A,B,C. Row3: Property-text| Txtbox. Row4: Property-text| ComboBox of values E,F,G. ** I can not understand how to get this started. I am using Net...

Why does JComboBox.removeAllItems() throw NullPointerException?

jComboBox.removeAllItems does not complain until after items are added (it gets called once before the JComboBox is populated from a configuration file). Stepping through this code I see jComboBox.removeAllItems calls JComboBox.removeAllItems which calls DefaultComboBoxModel.removeAllElements which calls fireIntervalRemoved. There are se...

linking jcombobox values with jtextfield values

I've created an application in netbeans IDE 6.9 where I need to set values for each value in the jcombobox. In my pane I've a combobox and below that are the textfields for entering values for each value in the combobox. Can anyone suggest that how do I link the combobox with textfield. I mean there are different values for each value in...

how to modify the values of other fields in JDialog box based on the value in combo box

I am making a dialog box for the application.And I want to fetch the values from the other fields(such as textField) based on the value of combo box. Can anyone please tell me how to link both of these components? -Thanks in advance ...

Solved: Why does JComboBox seem to add multiple item instances?

This Java Swing JComboBox is modified based on changes to the system configuration. In the example image, "Press to Select" is the case where nothing is selected and there is one "Test Unit" in the configuration, but "Press to Select" is displayed twice in the drop down. The additional "Press to Select" item behaves like item 0 so it is ...

JCombobox adding different color to each item

Hi, I have a doubt on Jcombobox... for example, i have a gui which contains a jcombo box and a button... In Jcombo box ,i have added string array object like color 1,color 2 ,color 3: String[] colors = {"Color 1","Color 2","Color 3"}.and i can select color when clicked the button by using of colorchooser and it will apply into the bu...

JComboBox sizing issue in a table with Multi line Cells

Hello Everyone, I recently had a problem where I needed to have a field that can wrap the text and increase the height of the row as the text is wrapped, similar to Microsoft Excel. I managed to get it working correctly, the only problem is that the table contains multiple JComboBoxes. When the row's height increases from the field tha...