-1

I am creating an RAP application in JAVA. i want to have a GUI like master detail. in which left side has panel that has a tree (like in windows 7) and on the right side there will be text fields which will be changing when different TreeItem is selected. So i have to add two panels, but i don't know how to add panels into composite. Please help

Favonius
  • 13,959
  • 3
  • 55
  • 95
Asad Ullah
  • 117
  • 1
  • 3
  • 11

2 Answers2

0

use frame.getContentPane() to the the master contentpane. Set its layout as new GridLayout(1,2). Now create two panels and add them to the frame. http://docs.oracle.com/javase/tutorial/uiswing/components/panel.html

There are also more complex solutions depending on what you want to do. For example if you want to make the division of the space between left and right side cosumizable use jsplitpanes (http://docs.oracle.com/javase/tutorial/uiswing/components/splitpane.html).

Masood_mj
  • 1,144
  • 12
  • 25
0

SWT is one thing, Swing is another. If you already have something written in SWT and want to add Swing components, then you have to use the SWT/AWT Bridge. You can find a tutorial on how to do this here.

Radu Murzea
  • 10,724
  • 10
  • 47
  • 69