Most voted "jcombobox" questions
A Jcombobox is a graphical component of the Java Swing API composed of a button or editable field, and a drop-down list of options. Use this tag for questions regarding situations involving this component.
Learn more…27 questions
Sort by count of
-
7
votes2
answers2360
viewsFill Jcombobox with an object
I would like a help to fill one JComboBox with a class. In this class, return two parameters: Id and Desc. Category class I need to show in combo: private int Id_categoria; private String…
-
6
votes1
answer481
viewsHow 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)); However, I would like to know if there is a way that after I choose an option,…
-
4
votes2
answers438
viewsList years in Jcombobox dynamically from certain rule
I have an application that lists records in a JTable, and each record has a registration date using Date. On this list, I put one filter per year via JCombobox, where the initial year is what the…
-
4
votes1
answer258
viewsAssign a function to Jcombobox
I am with the following doubt, I have a combobox, and I want that when you click on one of the combo options, it does something. I wanted to know how I put a variable or method "linked" to combo…
-
2
votes1
answer1603
viewsPerform 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 of a combo is selected I wanted to assign a value to a string from an external class,…
-
2
votes2
answers385
viewsDisplay Jcombobox object data in a Jtextarea from the selected item
I wanted to show the data of a customer who is on a combobox inside a Jtextarea, as in the following image: The problem is that only the information of "Igo Brasil" is shown, when I try to show the…
-
2
votes1
answer169
viewsDoubt with Jcombobox to insert data at runtime
I’m new to Swing and this is the first Java application I’m actually doing, but I’m having doubts about Jcombobox, because I would like to make a field (Jtextfield) where I put the directory and…
-
2
votes1
answer145
viewsJcombobox popup 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 actually been marked, it is necessary to open again.…
-
2
votes1
answer699
viewsGrab Id of an objects in the combobox
In a Frame for registration of cars, I have a combobox1 with the brands of cars and another combobox2 with the models, when I choose a brand in CB1 only appear in CB2 the models related that brand.…
-
1
votes3
answers1558
viewsJcombobox update from another Jcombobox
My idea was to make a Jcombobox whose values were updated according to the previous Combobox options. I’m using several Arraylists. For example, a Combobox with January and February option... If you…
-
1
votes1
answer141
views -
1
votes1
answer173
viewsHow to recover combobox index from a string?
I have the String for a combobox item, but when the user clicks on the table, the combobox should automatically select the category for that particular item. However, I found that there is no…
-
1
votes1
answer87
viewsFill in a jCombobox using Join and Hibernate
I’m doing a job at college where I’m supposed to create a scheduling system for car dealerships. The technologies used are Java, Swing, and Hibernate. I divided the project in layers to facilitate,…
-
1
votes1
answer1423
viewsPick object id attribute selected in Jcombobox
I have a table in BD with Columns Id, Board N° and Drilling on board. I’d like to show on JComboBox the concatenation of "Plate N° + Drilling". Example: Plate 10 - 113,00 mm But when a combobox item…
-
1
votes1
answer287
viewsItem in selected combobox, display data in jTable
Before asking this question, I searched the forum and in several places but could not solve... I have a combobox that already carries the names of customers, then I wanted to select the customer,…
-
1
votes1
answer139
viewsHow to use a Jcombobox of one class in another?
I want to create two screens, one registers the values of Jcombobox and the other I use the values. I can get the Combobox back but there’s no value. Class of register public class Combo extends…
-
0
votes1
answer356
viewsHow to validate jcomboBox before saving
I have the following problem, I am trying to validate these jcombobox, I want that if the user does not select an item from the movie jcombobox, a message appears: "Select Movie", if it is the…
-
0
votes1
answer2116
viewsPopular Jcombobox with Strings and Ids brought from the database
I need a popular JComboBox with the data brought from a table in my Mysql Database, but I don’t know how to leave an item attached to the corresponding ID. Example: ID 1 refers to the ADM profile…
-
0
votes1
answer425
viewsHow to validate if a String already exists in the Jcombobox list?
It follows the code that I am locked, I wonder how do I validate if a directory that I will add, already exists in JComboBox? package view; import java.awt.BorderLayout; import java.awt.EventQueue;…
-
0
votes1
answer62
viewsUse user-selected content in Combobox as key (map) in Enum class
All right, you guys? With a difficulty. That’s exactly what the title says. Code containing the Cbox: JFileChooser fc = new JFileChooser(new File(pastaPadrao)); String[] siglaStrings = {…
-
0
votes1
answer1097
viewsSet selected Combobox item as clicked on jTable
I am trying to fill in the form fields as per the item clicked on jTable. Text fields are normally filled in, but the combobox remains at the selected default value. //método que preenche a comboBox…
-
0
votes0
answers30
viewssetar Jcombobox item
I have two Jcombobox, the two contains strings referring to names of buyers and products. I need that when clicking on the table I can set the Jcombobox with the names. I saw in this forum two…
-
0
votes0
answers76
viewsAdd Object to Jcombobox
I’m trying to add an object in the jCombo box, but, it’s saying showing the message that the Object cannot be converted to String, being that I’m using the public String toString() Follow the Model…
-
0
votes1
answer21
viewsAdd first item to Jcombobox
I’m filling my Jcombobox like this: private void preencherCombo( ){ jComboEstado.removeAllItems(); List<Estado> lista = ec.listaObj(""); jComboEstado.addItem("Selecione um estado"); for(…
-
0
votes1
answer27
viewsMutable jcombobox
People, I’m working on a vacation record. The person places the initial date and a combo with the amount of days (10,15, 20 and 30) appears for her to complete it. Until 30 days of holidays are…
-
-1
votes1
answer110
viewsHow to add to Abstracttablemodel a combobox populated by database information?
I would like to know if it is possible to implement a combobox in a AbstractTableModel so that it receives information directly from the database for filling. if possible someone could give me an…
-
-1
votes1
answer53
viewsHow can I display a string provided with an arraylist in a combobox?
Good morning. I have a record of films, which are found in an arraylist. These films have a name, director etc. Since this array is public, I would like to display, in another interface, the name of…