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)?
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).
Dave Taubler<br />Specializing in <a href="http://taubler.com/articles/" target="_blank" rel="nofollow">Java and Web Development</a>
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 ]
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...
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.
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.
Dave Taubler<br />Specializing in <a href="http://taubler.com/articles/" target="_blank" rel="nofollow">Java and Web Development</a>
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.