In my Java Swing application, I have buttons. If the screen size is changed, I want to change the font of my button text also.
How do I implement it?
In my Java Swing application, I have buttons. If the screen size is changed, I want to change the font of my button text also.
How do I implement it?
I believe that you need a JFrame window listener and simply change the button attributes there:
//global JButton button1 defined earlier
button1.setFont(new Font("<FONT NAME>", <FONT STYLE>, <FONT SIZE>))
GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()
?
Thanks to all,
Based on listeners and frame size, border size and actual panel size I have figured font sizes for various screen size ranges.