TLTEO
asked on
how to use the current frame size.
I set a frame to initial value (500,700);
But I allow the user to resize it by draging the edges.
How can I continue to use this new size for all the other frames that wud come along??
and also as and when they start up again??
But I allow the user to resize it by draging the edges.
How can I continue to use this new size for all the other frames that wud come along??
and also as and when they start up again??
ASKER
do you have any example to do it??
no,
what part do you need help with ?
what part do you need help with ?
ASKER
for example, this frame will be use most of the time.
The old frame is diposed by mainFrame.dispose() method
public Myapp {
.
.
.
mainFrame = new JFrame("This 1st frame");
mainFrame.setSize(700,580) ;
content=mainFrame.getConte ntPane();
content.setLayout(new BorderLayout());
if I resize to (800,700) .. how can I get the resized 'size' and pass it to the next frame (which is actually previous.dispose(); Or rather how to use this new resized value thruout??
what is the syntax to get the new size?
The old frame is diposed by mainFrame.dispose() method
public Myapp {
.
.
.
mainFrame = new JFrame("This 1st frame");
mainFrame.setSize(700,580)
content=mainFrame.getConte
content.setLayout(new BorderLayout());
if I resize to (800,700) .. how can I get the resized 'size' and pass it to the next frame (which is actually previous.dispose(); Or rather how to use this new resized value thruout??
what is the syntax to get the new size?
// member
Dimension lastSize = new Dimension (700, 800);
// before disposing old frame save the size
lastSize = frame.getSize();
// after creating Frame - save the size
frame.setSize(lastSize.wid th, lastSize.height);
Dimension lastSize = new Dimension (700, 800);
// before disposing old frame save the size
lastSize = frame.getSize();
// after creating Frame - save the size
frame.setSize(lastSize.wid
ASKER
so actually I will also save the lastsize in .ini, and before the application starts , I will look into the .ini for the lastsize??
> so actually I will also save the lastsize in .ini, and before the application starts , I will look into the .ini for the lastsize.
yes - that's exactly what I suggested.
yes - that's exactly what I suggested.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2. save new size in some sort of .ini file.