View unanswered posts | View active topics It is currently Wed Jun 19, 2013 10:52 am



This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
 JLayeredPane & MigLayout problem 
Author Message

Joined: Fri May 11, 2007 4:20 pm
Posts: 65
Post JLayeredPane & MigLayout problem
Hello,

MigLayout doesn't seems to be happy with JLayeredPane
especially with the method add
With the JLayeredPane add can use integer for the Layer
add(Component, layer, position):

Thanks,

Olivier


Wed Oct 22, 2008 9:33 pm
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JLayeredPane & MigLayout problem
MigLayout does not make any distinction on the type of container and thus is shouldn't matter that it's a JLayeredPane. Can you make a snippet that shows the problem compared to a normal panel?

Cheers,
Mikael


Thu Oct 23, 2008 2:31 pm
Profile WWW

Joined: Fri May 11, 2007 4:20 pm
Posts: 65
Post Re: JLayeredPane & MigLayout problem
Hi Mikael,

Here we go.
A small example with JLayeredPane.
If you uncomment the part with MigLayout, it just doesn't run.

Thanks,

Olivier

PS : Any new on your blog? :-)


Attachments:
MigLayeredPane.zip [721 Bytes]
Downloaded 133 times
Thu Oct 23, 2008 5:40 pm
Profile WWW

Joined: Fri May 11, 2007 4:20 pm
Posts: 65
Post Re: JLayeredPane & MigLayout problem
oops.
I just realized that this post is in the wrong Forum.
Sorry about that.

Olivier


Thu Oct 23, 2008 5:44 pm
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JLayeredPane & MigLayout problem
Hello Olivier,

you have mixed up the arguments.. The second argument is not the layer index, it is the constrains for MigLayout. The third is the layer index.

There will probably be an update on the blog soon. I haven't had as much time as I would like lately and the WebStart demo is not done. It will be GUI only though, no real functionality..

Cheers,
Mikael


Thu Oct 23, 2008 7:56 pm
Profile WWW

Joined: Fri May 11, 2007 4:20 pm
Posts: 65
Post Re: JLayeredPane & MigLayout problem
Hi Mikael,

But in the doc :
http://java.sun.com/j2se/1.5.0/docs/api ... dPane.html

They give some example :

"Here are some examples using the method add(Component, layer, position): Calling add(5x, 5, -1) results in:

5a, 5b, 5c, 5x, 2a, 2b, 2c, 1a

Calling add(5z, 5, 2) results in:

5a, 5b, 5z, 5c, 5x, 2a, 2b, 2c, 1a

Calling add(3a, 3, 7) results in:

5a, 5b, 5z, 5c, 5x, 3a, 2a, 2b, 2c, 1a "

Is it a specific case for JLayeredPane?

Thanks,

Olivier


Thu Oct 23, 2008 8:07 pm
Profile WWW
Site Admin

Joined: Mon Dec 06, 2004 4:24 pm
Posts: 2485
Location: Sweden
Post Re: JLayeredPane & MigLayout problem
But the method you call is JLayerPane.add(Component comp, Object constraints, int index)

The Docs seems to be totally wrong..


Thu Oct 23, 2008 11:01 pm
Profile WWW
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 7 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.