jcombobox

JTable with a CellEditor containing a JComboBox on a JPanel

Hello, you can reference this question for the initial problem: http://stackoverflow.com/q/3826264 . This table consists of cells that are both editable and not editable. For some reason, clicking on the cell editor that contains the JPanel with the JComboBox after clicking on a non-editable cell does not bring the cell into edit mode....

JComboBox causes a runtime error

Hi, I'm trying some GUI development in Java and when I added the following code, I got a runtime error during initialization of the class: public class Search_Album_Main_Tab extends JPanel{ JComboBox search_list; JTextArea searched_data; JButton search_button; Results_Main_Tab rmt; Search_Action_Listener lis...

JComboBoxes - Using setModel to access Objects (in Swing)

Hi, Quick background, I am using Netbeans to develop this (I don't have much experience with Swing and have lost points on experience at the chance to gain development speed). In Netbeans it is obviously restrictive as to what code you can modify to stop novice users breaking the code (which I have already amusingly done once) Anyway, I...

displaying images in JComboBox

i need to display a image in JComboBox ...

jComboBox set selected item not working properly

Hi Everyone, I'm trying to populate my jComboBox with the following items: public class DropDownItem { private String text; private int id; public void setText(String text) { this.text = text; } public void setId(int id) { this.id = id; } public String toString() { return text; } public int getId() { return id; } ...

How can I remove the gap when using a JButton as a ComboBoxEditor in the Windows L&F?

I'm trying to use a JButton as an editor within a JComboBox. On Mac OS X this looks fine, but on Windows using the system look and feel, there is an ugly gap left between the JButton editor and the combo button itself: This is the test code used to produce the dialog: import java.awt.*; import java.awt.event.*; import javax.swing.*;...

ComboBox - printing out the selected item

Hi, I am a little stuck. I can't figure out a much bigger problem than this, so I am going to the roots to eventually build my way up! I can't print the selected item in the combo box, currently I have an ActionListener for it: box.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent evt) { myBox(...

JComboBox in JTable Cell not showing up

Hi, i'm trying to edit the content of the cells of a certain column in my JTable with ComboBoxes. Therefore i simply use the code from the official Java Tutorial on JTables (http://download.oracle.com/javase/tutorial/uiswing/components/table.html). The relevant code ends up looking like this: tableModel = new NetworkTableModel(columnN...

adding an action listener to a JComboBox

I just want to print the selected option in the combo box, to a textfield. Please explain what's wrong because i have to complete it & explain it in class. Any help would be greatly appreciated. Thanks in advance. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class App3 extends JFrame implements ActionListen...