Another JFrame problem


B

bruce

I have a form that I have laid out. Now my problem is that the main
JFrame will NOT give me size I want. I grab the left border and move
it to where I want it, lift the mouse button, and it extends back to
size of my development screen. When I run the project, JFrame
completely fills my screen. But when running, I can move the frame
border
to the size I would like it to be.

How do "I" get control of my JFrame size?

Thanks..

Bruce
 
Ad

Advertisements

M

markspace

I have a form that I have laid out. Now my problem is that the main
JFrame will NOT give me size I want. I grab the left border and move
it to where I want it, lift the mouse button, and it extends back to
size of my development screen.


This probably depends on code that you haven't shown us. I have no
problems re-sizing my JFrames.

Can you analyze this a bit more, and supply us with an SSCCE that shows
the behavior? Emphasis on "short", I don't want some huge class
definition to wade through.

<http://pscode.org/sscce.html>
 
B

bruce

This probably depends on code that you haven't shown us.  I have no
problems re-sizing my JFrames.

Can you analyze this a bit more, and supply us with an SSCCE that shows
the behavior?  Emphasis on "short", I don't want some huge class
definition to wade through.

<http://pscode.org/sscce.html>

I really don't know how to post a SSCCE. I have done NO coding. Every
line of my layout has been totally generated by the NetBeans IDE.

In fact, this is when I noticed the JFrame problem. I was saving my
lay out and about to drop down in coding.

Thanks for the response.

Bruce
 
M

markspace

I really don't know how to post a SSCCE. I have done NO coding. Every
line of my layout has been totally generated by the NetBeans IDE.


Well, if you can't code, then there's little chance that you'll ever be
successful with a Java app, GUI builder or no. Sorry but that's just a
fact.

I use Matisse (the NetBeans GUI builder) often, but it basically *just*
handles layout. Once you have the layout, then you have to write code
to drive it. And occasionally I have to load the layout into the
debugger to step through it to find a problem. That's just the way it goes.
 
B

bruce

Well, if you can't code, then there's little chance that you'll ever be
successful with a Java app, GUI builder or no.  Sorry but that's just a
fact.

I use Matisse (the NetBeans GUI builder) often, but it basically *just*
handles layout.  Once you have the layout, then you have to write code
to drive it.  And occasionally I have to load the layout into the
debugger to step through it to find a problem.  That's just the way it goes.

I can code. My methodology is to lay the form out then start the
coding from there.

My JFrame problem appeared as I was completing the layout..

So, I'm off to coding now while I'm trying to get some help on this
weird JFrame problem.

Bruce
 
J

John B. Matthews

bruce said:
I can code. My methodology is to lay the form out then start the
coding from there.

My JFrame problem appeared as I was completing the layout..

So, I'm off to coding now while I'm trying to get some help on this
weird JFrame problem.

The pack() method of JFrame will never make the frame larger that than
the screen. I suspect that you have a nested component with too large a
preferred size. I usually just specify the preferred sizes of those
components that need it; pack() takes care of sizing the JFrame
accordingly. Here's my sscce: <http://pastebin.com/nWHciPh0>.
 
Ad

Advertisements

B

bruce

The pack() method of JFrame will never make the frame larger that than
the screen. I suspect that you have a nested component with too large a
preferred size. I usually just specify the preferred sizes of those
components that need it; pack() takes care of sizing the JFrame
accordingly. Here's my sscce: <http://pastebin.com/nWHciPh0>.

This is a real newbie question. I looked at your SSCCE code and wanted
to import it into NetBeans. How do I do that. When I did it, I got
several errors so, obviously, I'm doing it wrong.

Thanks, and sorry for asking such an elementary question....

Bruce
 
Ad

Advertisements

J

John B. Matthews

bruce said:
This is a real newbie question. I looked at your SSCCE code and
wanted to import it into NetBeans. How do I do that. When I did it, I
got several errors so, obviously, I'm doing it wrong.

I just used File > New File > Java > Java Main Class. I added a pointer
to Main.form as a comment in Main.java, if you want to try recreate the
designer state, too.

<http://pastebin.com/8aQBkmaz>
 

Top