Skip to content
Advertisement

Tag: jtable

Nimbus takes precedence over manually defined renderer?

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

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

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

Advertisement