Hi,
I would like to add java's default questionIcon to a corner button in a Scrollpane, however the image doesn't fit correctly (since the button is very small). What should i do to make the icon fit correctly?
Here is the code, It works, so you can try it out and see for yourselfs the problem :)
import javax.swing.*;
public class CornerButton extends JFrame
{
public CornerButton()
{
JTextArea area = new JTextArea(20, 20);
JScrollPane scroll = new JScrollPane(area);
JButton btn = new JButton(UIManager.getIcon("OptionPane.questionIcon"));
scroll.setCorner(ScrollPaneConstants.LOWER_RIGHT_CORNER, btn);
this.add(scroll);
}
public static void main(String[] args)
{
// TODO Auto-generated method stub
CornerButton mainFrame = new CornerButton();
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setVisible(true);
mainFrame.setSize(200,200);
}
}
NB. I posted the same question on Sun's forums but no one answered, hope I find some help from here :)
thanks in advance.