• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Positioning many panels...

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)?
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Marshal
Posts: 80742
485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 80742
485
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tell us what the error is, please.
 
Martin vanPutten
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic