MANU SINHA
MANU SINHA

Reputation: 121

Panel Using Swings

I am trying Swings on my own. This is my first day. I have been working on GWT for long. I am trying to get a hashMap with both String as key value pair and trying to display both the strings as two adjacent columns and a text box in third column.

Can someone help me with the exact code.

Am using JLabel, JTextField and JComponent.

Thanks.

Upvotes: 0

Views: 107

Answers (2)

maneesh
maneesh

Reputation: 1701

Check out GridLayout. It is similar to FlexTable in GWT One possible drawback is that it resizes all components to the same size. JTable or GridBagLayout will give you finer control, but you might find them conceptually difficult if you are starting out with Swing.

Upvotes: 1

chzbrgla
chzbrgla

Reputation: 5186

First, you should decide on the Layoutmanager you want to use for further development.

See here: http://download.oracle.com/javase/tutorial/uiswing/layout/using.html

When you have decided on that, go on and add your Components to a JFrame, using said Layoutmanagaer.

Pretty much everything you're looking for can be found in the linked tutorial. And I suppose you know how to retrieve key-value pairs from a Map - so no need to clarify on that?

cheers

Upvotes: 1

Related Questions