The Artima Developer Community
Sponsored Link

Java Answers Forum
Size great Problem

4 replies on 1 page. Most recent reply: Jul 17, 2003 1:52 PM by Anastasia Aourik

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 4 replies on 1 page
guillaume

Posts: 21
Nickname: salulezami
Registered: May, 2003

Size great Problem Posted: Jul 15, 2003 11:38 PM
Reply to this message Reply
Advertisement
Hello

I have a unresolved problem with the size of my Components. But let me explain this to you:

I do:

JScrollPane MyJSP=new JScrollPane(MyJTree);
MyMenu.add(MyJSP);

When i select the menu, the Pane is well visible, but is enormous, and I've only two elements in my Tree, the JScrollPane is as large as the screen.

MyJTree.setsize(100,100); doesn't work
MyJSP.setsize(100,100); doesn't work
.resize doesn't work

HELP !!! plz.

salule


Alex S

Posts: 27
Nickname: andu
Registered: Mar, 2003

Re: Size great Problem Posted: Jul 16, 2003 1:03 AM
Reply to this message Reply
Did you try setPreferredSize() method?

guillaume

Posts: 21
Nickname: salulezami
Registered: May, 2003

Re: Size great Problem Posted: Jul 16, 2003 3:55 AM
Reply to this message Reply
Thanks a lot, you've saved my life.

If I can ask you another question: In my Tree, when I select a node, I open a file. But in my tree, nodes are not selected when I click on this.
Do you know how resolve it ??
Thanks

Alex S

Posts: 27
Nickname: andu
Registered: Mar, 2003

Re: Size great Problem Posted: Jul 17, 2003 1:02 AM
Reply to this message Reply
I don't know. I'm not programming GUI generally so my knowledge in swing is reduce.

But things are quite easy as far as I know. So try to read java tutorial on JTree or search on google with the right keys and you we'll find what you need.

Anastasia Aourik

Posts: 2
Nickname: anastasia
Registered: Jul, 2003

Re: Size great Problem Posted: Jul 17, 2003 1:52 PM
Reply to this message Reply
You did not indicate what MyMenu is but I am assuming it is some JPanel component. Basically you need to apply a layout to the JPanel to define how you'd like your lay out components (like your scrollpane) on your JPanel (mymenu).

Get a good GUI book with examples using different layout managers to see which one will work best for you.

Cheers,
Anastasia

Flat View: This topic has 4 replies on 1 page
Topic: Database failure detection Previous Topic   Next Topic Topic: Garbage Collection

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use