Fixing Base JFrame width

B

bruce

Can I set the width of the base JFrame to be a constant? When I scroll
I want the vertical size to expand and contract but I want the
horizontal to be a constant.

Thanks..

Bruce
 
B

bruce

Can you be more specific?  What scrolling of a JFrame are you doing?  Do
you actually mean a JScrollPane?  JScrollPane offers quite a lot of
control over not just the display of the scrollbars, but also of the
layout of the children it contains.

Information on this page might be useful for you:http://download.oracle.com/javase/tutorial/uiswing/components/scrollp...

This section in particular might be applicable to your question:http://download.oracle.com/javase/tutorial/uiswing/components/scrollp...

I'm sure what you want to do can be done.  But with such a vague
question, it's hard to understand exactly what it is you want to do.

Pete

I want to FIX the width of my window, let's say 500 pixels in width. I
want to be able to change the window height, depending upon height. I
can see what you mean by missing clarification. I want to be expand
and contract my window in the vertical direction but dragging on the
window border but I want the horizontal window window to be a constant
so that I can't expand or contract the width.

Thanks for the URL suggestions. I checked them out they don't seem to
have any hints on what I'm trying to do.

Hope this is more helpful.. Thanks for the response..

Bruce
 
B

bruce

Does your question actually have anything to do with scrolling at all?
You asked about scrolling in your initial question, but your reply
doesn't mention it.

If you are not asking about scrolling, but only about the main window
size, then AFAIK you have to add a listener to the window to track the
size changes, and reset the size (the width, in this case) to your
maximum if anything tries to set it larger (such as the user dragging it)..

The JFrame class, like other Swing components, allows you to set the
maximum size.  But the last time I was trying to do this, the maximum
wasn't enforced (it's used during layout, not general UI changes).

Pete

Yes, your response is what I was looking for. I tried that Maxsize and
nothing happened

Also, what is AFAIK?

Thanks for the response...

Bruce
 
L

Lew

As Far As I Know

FAQ Frequently Asked Question
TLA Three-Letter Acronym
LOA List of Acronyms
AFAICS As Far As I Can See
AFAICT As Far As I Can Tell
AIUI As I Understand It
ISTR I Seem To Recall
RTFM Read The Fucking (Fine) Manual
GIYF Google Is Your Friend
WIYF Wikipedia Is Your Friend
JIYF the Javadocs Is Your Friend
WTF What The ...?
Huh? Huh? ( = "How the heck did you come up with that?")
??? Huh?
IANAL I Am Not A Lawyer
IMO In My Opinion
IMHO In My Humble Opinion
IMNSHO In My Not-So Humble Opinion
FU FollowUp
OTOH On The Other Hand
OTTH On The Third Hand
+1 I concur
-1 I disagree
SSCCE Simple Self-Contained {Correct|Compilable|Confirming} Example
TINSTAAFL There Is No Such Thing As A Free Lunch
.... and many more

The distinction between acronyms and initialisms is not enforced by some of these.

You're expected to be familiar with others like "FUBAR" already.
 
T

Tom Anderson

TLA Three-Letter Acronym

ETLA - extended three-letter acronym
AFAICS As Far As I Can See
AFAICT As Far As I Can Tell

IIRC - if i remember correctly
AICMFP - and i claim my five pounds
IANAL I Am Not A Lawyer

YMMV - your mileage may vary
IMO In My Opinion
IMHO In My Humble Opinion
IMNSHO In My Not-So Humble Opinion

IMNERHO - in my not even remotely humble opinion
FU FollowUp

has other meanings.
OTOH On The Other Hand
OTTH On The Third Hand

OTGH - on the gripping hand
+1 I concur

AOL - me too
... and many more

HTH - hope this helps
HAND - have a nice day
HTH. HAND. - this answer is sarcastic, please **** off

tom
 
J

Joshua Cranmer

GIYF Google Is Your Friend

LMGTFY Let me Google that for you
FU FollowUp

This reminds me of a little conversation heard in an English class:

"What does this BS on my paper mean?"
"Be specific"
"Oh, okay."
"It also means bullshit."
 
M

Mike Schilling

Thomas Pornin said:
The Moon is a _Harsh_ Mistress. I have got the book in my library, right
before my eyes.

Who are you going to believe: me, or your lying eyes?

(Actually, I mixed up the actual title with the parody version _The Moon is
a Hard Mattress_.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,196
Latest member
ScottChare

Latest Threads

Top