简体   繁体   中英

How do I add a Table Layout to a Java GUI in NetBeans?

For my employers purposes we are moving from .Net to Java. I have worked with .Net for the better part of the past two years and I have worked with Java for like... two months. I know very little about it.

A bit of google searching and my employers counsel revealed that NetBeans has a GUI builder, and I've begun working with it and I like what I see. It feels very familiar to me from working with .Net.

However, what my google searches did NOT reveal was the answer to my question that I am asking here, which I suppose is two-fold:

1: What is the Java/Swing/AWT Equivalent to .Nets (C#/VB) TableLayoutPanel component (if one exists) 2: If it does exist, how do I go about adding it to the NetBeans IDE GUI Palette to make use of it? (I'm REALLY hoping it's as easy as drag/drop but I'm not holding my breath).

There is no specific panel with a table layout, but you can use a regular JPanel and give it a GridLayout :

JPanel pane = new JPanel( );
pane.setLayout( new GridLayout( nrOfRows, nrOfColumns ) );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM