Top "Jbutton" questions

A JButton is a common button in Java Swing.

Can I make Swing JButtons have smaller margins?

I prefer buttons with minimal margins, about as wide as their text caption. Is there a way to achieve that …

java swing jbutton margin
JButton expanding to take up entire frame/container

Hey everyone. I'm trying to make a swing GUI with a button and a label on it. im using a …

java user-interface swing jframe jbutton
Pass arguments into JButton ActionListener

I'm looking for a way to pass a variable or string or anything into an anonymous actionlistener ( or explicit actionlistener ) …

java swing jbutton actionlistener
JOptionPane with username and password input

I have my own Dialog pop up with two textfields, two JLabel and a "ok" JButton. The pop up is …

java jpanel jbutton jtextfield joptionpane
How to change Yes/No option in confirmation dialog?

I want to change YES and NO to something like Agree/Disagree. What should I do? int reply = JOptionPane.showConfirmDialog(…

java swing jbutton joptionpane
Null pointer exception when an ImageIcon is added to jbutton in NetBeans

An ImageIcon is added to button properties using NetBeans. print.setFont(new java.awt.Font("Serif", 0, 14)); print.setIcon(new javax.…

java swing jbutton imageicon
Changing Font Style when Clicking on a JButton Java

How to change the STYLE of the Font when clicking on a JButton ? I'm trying to have 3 buttons each change …

java swing fonts jbutton
JOptionPane Passing Custom Buttons

I'm trying to get the value returned by custom buttons passed to JOptionPane. However the buttons I pass don't return …

java swing jbutton joptionpane
How do I assign Enter as the trigger key of all JButtons in my Java application?

I'm writing a Java Swing application using the Metal look-and-feel. Every time there is a JButton in my application the …

java swing events jbutton
Hovering over JButtons and displaying a message

I want to hover over a number of JButtons on my GUI (map) and display the name of that location …

java swing tooltip jbutton mousemotionevent