Java Qt Extensions

Examples

Example4 - Container

The example shows a container component.

QSwing provides container components, components that can contain other QSwing components. Unlike Swing, all components are not containers.

Code

package yu.ac.bg.etf.javaqx.examples;

import yu.ac.bg.etf.javaqx.qswing.JQLabel;
import yu.ac.bg.etf.javaqx.qswing.JQPanel;
import yu.ac.bg.etf.javaqx.qswing.QSwing;

/**
 * Container Example.
 */
public class Example4Container {

  public static void main(String[] args) {
    JQPanel panel = new JQPanel();
    panel.setName("Container");
    panel.add(new JQLabel("Label1"));
    panel.add(new JQLabel("Label2"));
    panel.add(new JQLabel("Label3"));
    panel.add(new JQLabel("Label4"));
    panel.add(new JQLabel("Label5"));
    panel.add(new JQLabel("Label6"));
    panel.add(new JQLabel("Label7"));
    panel.add(new JQLabel("Label8"));
    panel.setSize(20060);
    panel.setVisible(true);
    QSwing.startEventLoop(true);
  }

}

Screenshots

Container on
Windows Vista
Container on
Windows XP
Container on
Windows 98
Container on
SUSE Linux
Container on
Ubuntu Linux