Making a GUI in Swing (NetBeans 15, Sun JDK 19.0.1), i’m trying to set custom background color for JTable rows and encountered issues with boolean cells, and i can’t seem to be able to make the background uniform across all cells. Please note that the following code tries to paint the background for the whole table, but my target is
Tag: jtable
How do I make it so that the table is displayed inside the JFrame in Main?
I am currently making a program for my school project, it is a fast food order calculator, my problem is that I have to be able to display the table inside the JFrame in Main, if I add “frame.add(table);” inside Main, nothing happens. Any help would be appreciated, thank you! } Answer Add frame.add(JScrollPane(table)); Change frame.add(label); to frame.add(label, BorderLayout.NORTH); Move
JTable multiple selection on Mac OS X
I have a Swing application and we are having a problem with some Mac users and JTable components. The tables have this selection mode set: On Windows with this selected you can: select a single row select contiguous rows by holding the mouse and dragging select contiguous rows by clicking the first row to select, pressing shift and clicking the
How do you reliably know which JTable row has been selected from multiple tables if there is only one query button?
Tried on Ubuntu 20.04 in case it matters. When multiple JTables are present, but you need to look at only the the last user selected row (or cell) of the last selected JTable, how can you reliably know which one that was? I’ve tried list select listeners and focus listeners, but all fail when you are editing a cell in
Text cursor is invisible when editing a JTable cell
The problem is that I have to click on the cell by mouse so that the text cursor is visible (after the cell get focused). I can still edit the cell even if the text cursor is invisible. When I try to get a cell focused through a keyboard key like Tab or Arrow then there’s no chance the text
JTable not visible inside JScrollPane
I have a JTable inside a JScrollPane. I want to show the table only when a particular button is pressed otherwise it should not be shown. Inorder to incorporate that I have set the setVisible method of the ScrollPane to false while declaring and I set it to true inside the actionPerformed method of the JButton. But the JTable is
JTable RowFilter – case insensitive
I’m having a problem with a RowFilter, I’m trying to make it display data without it being case sensitive. I tried adding “(?!)” in the RegexFilter but that only makes my table not display any data at all when I try searching. What am I doing wrong? Answer You probably wanted to prefix the search string with (?i) (case insensitive
Cannot display JComboBox in JTable with TableModel
Below code to display a JTable with 3 columns, which respectively contain a JComboBox, a String and a double, and which should display yellow. The problem is that I cannot get the JComboBox in the first column to display as … a combo box; instead I get a String saying “javax.swing.JComboBox…”. What am I doing wrong? Answer Never return a
Put firebase data in a JTable
I am struggling to put some firebase data into a jtable in java swing. As seen in photo I’ve been able to retrieve the data from firebase but for some reason the data won’t be displayed in the JTable field(table1) I looks like the getID(), getName()… methods didn’t get any value, since I tried to print row[i] to see if
How can I make a checkbox on JTable not editable after a checkbox is clicked?
I have created a JTable with 4 columns, the last two columns are JCheckBoxes. I would like to disable the checkbox in column three after I clicked the checkbox on column two and vice versa. This is what I’ve done so far but both column 2 and 3 are editable. Please help. Thank you. Answer but both column 2 and