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…
Tag: swing
How do I close a JOptionPane once a button is clicked?
I’ve seen other solutions using yes-no-cancel options but I am using an array of three options for the user to choose from as a sort of pre-launch menu for my app. I’m sorry if my code is awful to look at, I’m still new to this. I want to close the JOptionPane.showOptionDialog() once any of …
Variables passes as null to another Java Frame in Netbeans
I am trying to take a value from MSSQL to a class. In my login GUI frame the variable passes exactly right, but when i pass that class object to another frame the name (String ograd) variable returns as null. Here’s the teachermanagement.java file: loginGUI.java file where i take variables from my MSSQL…
Swing – How to modify the border color of a JButton?
How to modify the border color of a JButton? I want to get something like this: But I can´t modify the color, the borde is black: And If I try to add a LineBorder or any other borde, I am not able to remove the inner border: Answer I tried an example below and all seems fine, unless you are
After inserting values in JTextField, their random value is not shown. How can I fix it?
I wrote this Java Application which is used to extract a random value from those entered in the JTextFields after starting a counter. Compiles and gives no errors, but the (“” +randomElement) value is not displayed. I created the randomElement property inside the TimerListener class in the actionP…
How to do image rendering using bufferedimage in a jframe?
I am trying to render a complicated set of objects, and instead of trying to render each object individually, I thought it would be faster to render them as a BufferedImage. The only way I could figure out how to do that was to turn the BufferedImage into an ImageIcon, and set that to a JLabel, and add the JL…
why if i make JTable take data from database delete the first row?
I’m trying to make a Table take the data where I make condition a delete from … to … , the data returns one row thinner, maybe one row deleted? my code: Answer the data come to me less thin a one row You read the first row outside the loop, so it is never added to the model. Your
Is there a way to skip a mouse click for ActionListener?
I have a Tic Tac Toe GUI that lets a user play against a computer. I use an actionListener to receive the users mouse clicks on where they want to put their “X” on the board. The problem I have is, the way my code is set up, my GUI waits for a mouse click whenever it’s the computers turn
java swing – How to draw Rects one on top of the next using?
Using java swing, I have a horizontal line (acting as the horizon). I want to draw rects, stacked, one on top of the other where the rect with the largest width is at the bottom and the rect with the smallest width is at the top. I also want the rects to stick to the horizon when the user re-sizes
How to remove the border of an Icon in a JButton using Eclipse?
first time making a question here. First of all, Eclipse (as far as I’m aware of) don’t let you re dimension images through the design tab directly so to solve this I made a method that convert the icon from ImageIcon to image, re dimension it and then convert it back. The problem is that when I u…