why doesn't idea offer a null layout of swing?

there is no null layout so that I can't lay sth anywhere I like.In the latest eap ,I still failt to see that function.It is a pity.

6 comments
Comment actions Permalink

This question doesn't make sense to me.

I can only guess you are using IntelliJ's GUI builder, in which case why would you need a null layout if you are using the gui builder to create your GUIs?

0
Comment actions Permalink

I have mentioned the reason--I want to put them anywhere ,in a abstract position.Using the other kind of layout manager in swing is very inconvenient.No matter jbuilder,wsad,netbeans,jdeveloper or swt-desinger(a kind of swing plugin for eclipse) they all offer the null layout,why not idea?

Ok,let me make it more clear.First I would put the components in null layout,when I complet laying them,I will change the layout into another more advanced layout such as GridBagLayout,at the moment the ide should change the related codes of null layout to the related codes of GridBagLayout,thus it is more convenient than use GridBagLayout directly.Is it?

Edited by: fxbird on Jun 28, 2008 6:40 PM

0
Comment actions Permalink

I know a few developers tried to use it for an app that is essentially a kiosk type application where the screen resolution is fixed and the app has full screen at all times so behavior during resizing is not a big deal. They stopped due to text fields changing sizes depending on their contents and the inability to put things exactly where they wanted them. I'm guessing there was a way to stop the text field issue (I don't see it happen in Idea), but the positioning thing made them look at other tools and ended up buying one that was not as nice to use.

0
Comment actions Permalink

... They stopped due to text fields changing sizes depending on their contents and the inability to put things exactly where they wanted them. I'm guessing there was a way to stop the text field issue ...


yes, use textField.setColumns(10).

A text field computes its preferred size based on its text. If the text content is long, the preferred width of the text field is large and a layout manager probably makes the real width of the text field very wide. So I recommend always to use setColumns() for all text fields.

JGoodies FormLayout allows to specify a maximum width for columns, which can be used to avoid that the column gets too wide.

0
Comment actions Permalink

I have mentioned the reason--I want to put them anywhere ,in a abstract position.Using the other kind of layout manager in swing is very inconvenient.No matter jbuilder,wsad,netbeans,jdeveloper or swt-desinger(a kind of swing plugin for eclipse) they all offer the null layout,why not idea?


If you are looking for a GUI builder that supports null layout and runs in IntelliJ IDEA, you could try JFormDesigner (http://www.formdev.com/).

Ok,let me make it more clear.First I would put the components in null layout,when I complet laying them,I will change the layout into another more advanced layout such as GridBagLayout,at the moment the ide should change the related codes of null layout to the related codes of GridBagLayout,thus it is more convenient than use GridBagLayout directly.Is it?


Well, you can do this with JBuilder <= 2006, but the result is not optimal because when converting the null layout to GridBagLayout it sets a lot of Insets, which makes it hard to change the layout later.

What you're probably looking for is GroupLayout (Free Design) in NetBeans or JFormDesigner 4.0. There you can freely place the components and guidelines help you to align components.

0
Comment actions Permalink

yes ,it is ok to use jbuilder,but it needs extra money to buy it.I want to convert the null layout to gridbaglayout when I am finished with the app.so when I run the final app,the effect I want is when I resize the window,the components inside can change their sizes automatically.I don't need to do converting between null and gridbaglayout very offten.Even offten do it,the wrong chang should't be much.At least I think it ok in jbuilder or netbeans,but in jformdesinger the changeing effect is very bad.It's totally a mess when I convert null layout to gridbaglayout. Also I think it's a useful and practical function so idea should implement it some time.

0

Please sign in to leave a comment.