Setting 1 or 2 character text on a 32x32 JButton
3 answers
I don't think this is possible, it is managed directly with the look'n'feel that Java uses. You can try changing it to something else to see if it has different inserts. You can try changing them by programming smaller insects.
A more complicated way would be to subclass the class JButton
and provide a custom blueprint implementation, but I think you will lose all the other cool effects.
+1
source to share
As per my idea , its quite simple to making GUI application easier.I am writing some code below it may help you .
public static void main(String[] args) {
// TODO Auto-generated method stub
JFrame frm=new JFrame("Manoj Button Test");
frm.setVisible(true);
frm.setSize(500,500);
Container cnt=frm.getContentPane();
//You can add any text to the JButton
JButton btn=new JButton("Hello Button");
cnt.add(btn);
//2nd type of example
JButton btn2=new JButton();
int number_btntext=4;
btn2.setText(String.valueOf(number_btntext));
cnt.add(btn2);
}
In the above code I have set text to GUI JButton.
0
source to share