I’m making a program which includes JButtons with the text “+” and “-” on them. Why does the JButton have an outline around the text within? How do I get rid of the square around …
Tag: jbutton
How do I enable a button after the scrollbar goes to the bottom?
So, I used a JScrollPane and then I added a JTextArea. I used textArea.setCaretPosition(0) to reset the scroll and it went at the top. All good, until I wanted to set a disabled Button on enable when the scrollbar reaches at the bottom. How can I do that? Answer You can listen for changes to the JScrollPane’s viewport, and compare
Java JFrame button organization
How do i create a jframe that organizes the text box and jbuttons, with the textbox on top and a 3 by 4 grid layout of buttons 1-10? This is what I have so far: But that’s where I’m stuck. Okay I should note that I need a for loop to populate 3 by 4 gridlayout. But I don’t know
Container not displaying in JScrollPane
I have a JScrollPane that will fill up with buttons added by the user. Currently, the user creates a new button and it is added to the container that is inside the scroll pane but nothing is displayed….
No output after button click, since the variable doesn’t exist?
I wanted a frame with one TextArea and one Button. When I press the button, the TextArea should show a food menu of 5 Pizzas, well it shows nothing at all, except for the console which shows In the method windowsStart() the objects exists and are adjustable. In the actionPerformed()Method the objects are … kind of invisible, not existing? The
How do I stop JFrame/JPanel from auto-formatting the distances between my components?
So I’m writing a program which utilizes a GUI. The GUI is built from a JFrame and a JPanel in Java. I have a JTextArea() and a JButton() that appears beside the JTextArea on the left. I also have an image which I imported locally using the method call below (“f” is the variable name of my JFrame): I don’t
Using custom TableModel make isCellEditable true for a particular row on button click
I have a table like above. Initially all the cells except button column are not editable. I have created the table using custom TableModel. My isCellEditable in custom TableModel looks like this: But when I click on the Edit button of each row a JDialog will pop up with that row (by constructing a JTable in this dialog with only
Adding Buttons inside cell of JTable along with data?
Is it possible to add buttons inside the JTable cell along with data? What I am trying to do is to create a table with columns which display data(number) from the database, and two buttons to increase/decrease the number inside the same cell. |ID | Quantity| |06| 2 [+][-] | it would be something like above with [+][-] being buttons.