Hi i am trying to implement Action listener for JButton and code look like following:
ImageIcon imageForOne = new ImageIcon(getClass().getResource("resources//one.png"));
one = new JButton("",imageForOne);
one.setPreferredSize( new Dimension(78, 76));
one.addActionListener(myButtonHandler);
Using the above JButton it looks fine
When i add specific value to button for e.g.
ImageIcon imageForOne = new ImageIcon(getClass().getResource("resources//one.png"));
//Check this
one = new JButton("one",imageForOne);
one.setPreferredSize( new Dimension(78, 76));
one.addActionListener(myButtonHandler);
It look like the following image
Is there any way i can avoid this and set the value too.
Thanks for your help in advance.