English 中文(简体)
Java Swing Gridlayout 核查限制
原标题:Java Swing Gridlayout VERTICAL constraint

是否有可能在电离层垂直中增加部件? 我指的是前面的下一个步骤?

谢谢。

最佳回答

无,没有任何布局允许你纵向从底部走,至少我知道。 如果你想要纵向打字,你可以使用一个<条码>(GridLayout)和一个单列或<条码>(BoxLayout)和一个垂直轴。 通过开门板和把布局结合起来,你很容易获得你所需要的东西,例如,在横向集装箱内布设的板块和垂直布局。

问题回答

诸如BoxLayout和GridLayout等青年在你使用时从上至下展示成分:

panel.add( someComponent );

但你可以始终使用:

panel.add(someComponent, 0);

插入顶级部件。

虽然这一答案与Gridout无关,但是将高度建议采用JGoodies表格的形式。 http://www.jgoodies.com/freeware/forms/index.html“rel=“nofollow” http://www.jgoodies.com/freeware/forms/index.html。

                          /* 1                    2      3       4    5                   6     7      8       9*/      
            String col1 = "left:max(20dlu;pref), 3dlu, 70dlu, 15dlu,left:max(10dlu;pref),10dlu, 70dlu, 70dlu, 70dlu";
                          /* 1   2     3   4  5   6    7   8    */
            String row1 = "  p, 5dlu, p, 3dlu, p, 5dlu, p, 9dlu, ";
            FormLayout layout = new FormLayout( col1, row1 + row2 + row3 + row4 + row5 + row6);

            JPanel panel = new JPanel(layout); 
             panel.setBorder(Borders.DIALOG_BORDER);

            // Fill the table with labels and components.
            CellConstraints cc = new CellConstraints();
            panel.add(createSeparator("Registration Information"), cc.xyw(1, 1, 7));
            panel.add(new JLabel("Patient ID"), cc.xy(1, 3));
            panel.add(pid, cc.xyw(3, 3, 1));
            panel.add(new JLabel("Date and Time"), cc.xy(5, 3));

You can hand code to plot each component any where in the defined layout designed ie wrt to col and rows. Even vertical arrangement. Read whitepaper: http://www.jgoodies.com/articles/forms.pdf





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签