I'd like to do something like the following:
public class MyCustomDialog extends JDialog
{
public MyCustomDialog()
{
if (getClientVertScreenSize() < 800)
{
// Set the vertical size as 600, and give them a scroll pane to navigate to the bottom of the gui.
}
else
{
setSize(600, 800); // No need to add a scroll pane.
}
}
}
The trouble is I don't know how to check the clients' screen size, so I don't know how to write the method my constructor relies on.
See Toolkit.getDefaultToolkit().getScreenSize()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With