Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Positioning many panels...

 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know you can position panels by using BorderLayout or even FlowLayout... but it doesn't get my panels exactly as I want them... is there a way to set them eactly where you want them by using a from left and from top method (like css for example)?
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It takes some time to learn how to use what's available. For the long haul: Using Layout Managers.
For now: Doing Without a Layout Manager (Absolute Positioning).
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, take a look at SpringLayout. It's a new-ish layout manager, and among other things it allows you to position components relative to the top/bottom/left/right of other components (including their own containers).
 
Campbell Ritchie
Sheriff
Pie
Posts: 48981
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried examples with SpringLayout and couldn't understand them. have a look at this tutorial about GridBagLayout, and how Cay Horstmann recommends we simplify GridBagLayout with the GBC class. I like Horstmann's method, myself.
There are several pages about Layouts in the Java Tutorial.

[edit]I appear to have given some of the same links as Craig Wood[/edit]
[ April 05, 2007: Message edited by: Campbell Ritchie ]
 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I decided to stick with the absolute positioning... I like total control of my programs... but it gets this runtime error that I can't figure out... can anybody see anything.. this is one of my classes...
 
Campbell Ritchie
Sheriff
Pie
Posts: 48981
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell us what the error is, please.
 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the runtime error...
Exception in thread "main" java.lang.NoSuchMethodError: ViewPanel.<init>(LListener V
at ViewManager.<init>(ViewManager.java:23)
at Game.main(Game.java:15)

Process completed.
I am using JCreator as my editor... this is exactly how it represents the error.
 
dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you have a typo somewhere; either in the code that you posted, or in your actual code that you're trying to run. Did you inadvertantly create a class called "LListener" (with two "L"s), or just mistype?

At any rate, you are trying to invoke a ViewPanel constructor that apparently existed at one point, but no longer does. Try changing the argument list tha ViewManager passes to the ViewPanel constructor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic