Questions tagged as 'jcombobox'

2
answers

Fill JComboBox with an object

Would you like help filling out a JComboBox with one class. In this class, return two parameters: Id and Desc. Category class I need to show in combo: private int Id_categoria; private String Desc_Categoria; How do I show only...
asked by 28.12.2015 / 02:21
1
answer

How to "limit" a JComboBox according to the selected item?

I have a JComboBox , and I limit the size of it, with the following code: jcb.setPreferredSize(new Dimension(100, 21)); But I wonder if there is a way that, after I choose an option, the content is completely displayed. What happens i...
asked by 30.10.2016 / 00:19
2
answers

List years in JCombobox dynamically from given rule

I have an application that lists records in a JTable , and each record has a record date using Date . In this list, I put a filter per year via JCombobox , where the initial year is what the application started to use (2013)...
asked by 16.12.2015 / 12:01
1
answer

Assign a function to JComboBox

I have the following doubt, I have a combobox, and I want it when clicking on one of the combo options, it does something. I would like to know how I put a variable or method "bound" to combo options, for example if I clicked on option 1, it lis...
asked by 10.03.2017 / 18:17
2
answers

Display JCombobox object data in a JTextArea from the selected item

I wanted to show data from a client that is in a combobox inside a JTextArea, as in the following image: Theproblemisthatonlytheinformationof"Igo Brasil" is shown, when I try to show the information of another client, this happens: Infor...
asked by 25.04.2016 / 02:46
1
answer

Get Id from an object in the combobox

In a Frame for car registration, I have a combobox1 with car brands and another combobox2 with the models, when I choose a brand in CB1 only appear in CB2 the models related to that brand. Tags and templates are bank tables, which are used by a...
asked by 15.08.2018 / 20:53
1
answer

Popup of JComboBox is visible until you click the arrow

I have a JComboBox populated with JCheckBox's working normally, but when I click on an item, the JComboBox popup closes. To see if JCheckBox has really been checked, it is necessary to open it again. I wanted to know if it's possible t...
asked by 25.06.2018 / 20:20
1
answer

Doubt with JComboBox to enter data at runtime [closed]

I'm new to Swing and this is the first Java application I'm actually doing, however I'm doubtfully related to JComboBox because I'd like to do a field (JTextField) where I'd put the directory and click a button JButton) and send it to the JCombo...
asked by 13.01.2017 / 04:15
1
answer

How to retrieve index of combobox from a string?

I have the String for a combobox item, but when the user clicks the table, the combobox must automatically select the category of that certain item. However, I came across that there is no getIndex function as I put below. How can I retrieve the...
asked by 12.10.2017 / 21:12
1
answer

Execute actions from the selected item in JComboBox

I wanted to assign value to another class, whichever is selected in JComboBox . For example, if the "Active" item in a combo is selected I wanted to assign a value to a string of an external class if the user had put the combo item "Idle"...
asked by 13.03.2016 / 21:29