Hello,
How can i set pernament divider location on the base of the resolution. What i'm tryingto do is keep the still the same location of the divider after resize the jFrame form.
Thank you
Printable View
Hello,
How can i set pernament divider location on the base of the resolution. What i'm tryingto do is keep the still the same location of the divider after resize the jFrame form.
Thank you
(Untested) Add a ComponentListener to the JSplitPane and set the divider location in componentResized(...).
db
No. This is a forum, not a code mill. But I will guide you to a tutorial where you can learn about writing a ComponentListener.
How to Write a Component Listener (The Java™ Tutorials > Creating a GUI With JFC/Swing > Writing Event Listeners)
db
Please anyone can give me simple exaple ? I'm using NetBeans.
This is what i'm trying to do:
But it does not do anything and Divider stay same :( Pls helpCode:private void formWindowStateChanged(java.awt.event.WindowEvent evt) {
// int w = Toolkit.getDefaultToolkit().getScreenSize().width;
// int h = Toolkit.getDefaultToolkit().getScreenSize().height;
if (evt.getNewState() == frmMain.MAXIMIZED_BOTH) // If maximize
{
jSplitPane5.setDividerLocation(250);
}
}
Thank you
The visual designer you're apparently using isn't a beginners' tool, it's targeted at developers with considerable experience in coding Swing GUIs.
Learn how to code a Swing GUI, starting here: Trail: Creating a GUI With JFC/Swing (The Java™ Tutorials)
And please stop begging for code. I've already told you this isn't a code mill. We are happy to help less experienced people to learn to do things for themselves, but you have to put in that effort.
db