jbutton
jpanel with image in background
I have a simple doubt, I need to replace this: panel[1].setBackground(Color.red); For an image, but I want to avoid a new jlabel for image, because I tested and I have another label inside this pan[详细]
2023-02-09 07:03 分类:问答Java: using an image as a button
I would like to use an image as a button in Java, and I tried to do this: BufferedImage buttonIcon = ImageIO.read(new File(\"buttonIconPath\"));[详细]
2023-02-08 19:08 分类:问答stretched button in the gridLayout
everyone, I have some problem with Java I created panel with five rows and one column, also I added button to the one of the rows, finally I added this panel to the frame, 开发者_如何学Cand I received[详细]
2023-02-07 15:06 分类:问答center vertically jbutton inside jpanel -java
I have a border layout with 4 panels, north, south, east and west. For example in e开发者_开发问答ast side I have a jpanel which have four buttons. My problem is that all buttons are align to the top[详细]
2023-02-07 07:39 分类:问答How do I add an image to a JButton
I am trying to add an image to a JButton and I\'m not sure what I\'m missing. When I run the following code the button looks exactly the same as if I had created it without any image attribute. Water.[详细]
2023-02-07 05:53 分类:问答How to launch an .exe file by clicking a JButton in GUI?
I\'ve created a JFram开发者_C百科e with 3 Jbuttons. I\'d like the button to launch different .exe file located in the same folder. Is this possible? If yes, what should i write for the actionListener?[详细]
2023-02-06 00:31 分类:问答Can't a Swing component be added to multiple containers?
I\'m trying (testing something else) to add one JButton reference into two JPane开发者_Python百科ls to test it, and it disappears from the first panel it was added to![详细]
2023-02-03 10:54 分类:问答Accelerator for JButton
How do set a shortcut, eg. Ctrl+Q, to a 开发者_如何转开发JButton? JMenuItem has setAccelerator() method to set one, but JButton doesn\'t.Well, you can do a JMenu with a set og instruction, putting ins[详细]
2023-02-02 23:45 分类:问答Disabled Jbutton Swing not working well
I have a problem with开发者_运维知识库 Swing JButtons. I\'m working with Netbeans. When I disable a JButton in the GUI Builder it still fires the actions attached as events, i.e. I have a disabled but[详细]
2023-02-02 21:44 分类:问答How do I create individual button names in an array?
I\'m trying to make a game of battleship, I\'m in control of the boards. How do I make an array that will allow each button to return a position. For storing the ships and the hits and things. I want[详细]
2023-02-02 11:12 分类:问答