Package org.jdesktop.swingx

Examples of org.jdesktop.swingx.JXPanel


  frame.setVisible(true);
}

/** creates a JXLabel and attaches a painter to it. */
private Component doInit() {
  JXPanel panel = new JXPanel();
  //JPanel panel = new JPanel();
  panel.setLayout(new BorderLayout());

  // create a label
  final JXLabel label = new JXLabel();
  label.setFont(new Font("Segoe UI", Font.BOLD, 14));
  label.setText("task pane item 1 : a label");
  label.setIcon(Images.NetworkDisconnected.getIcon(32, 32));
  label.setHorizontalAlignment(JXLabel.LEFT);
  label.setBackgroundPainter(getPainter());

  // tweak with the UI defaults for the taskpane and taskpanecontainer
  changeUIdefaults();

  // create a taskpanecontainer
  JXTaskPaneContainer taskpanecontainer = new JXTaskPaneContainer();

  // create a taskpane, and set it's title and icon
  JXTaskPane taskpane = new JXTaskPane();
  taskpane.setTitle("My Tasks");
  taskpane.setIcon(Images.Quit.getIcon(24, 24));

  // add various actions and components to the taskpane
  taskpane.add(label);
  taskpane.add(new AbstractAction() {
    {
      putValue(Action.NAME, "task pane item 2 : an action");
      putValue(Action.SHORT_DESCRIPTION, "perform an action");
      putValue(Action.SMALL_ICON, Images.NetworkConnected.getIcon(32, 32));
    }
    public void actionPerformed(ActionEvent e) {
      label.setText("an action performed");
    }
  });

  // add the task pane to the taskpanecontainer
  taskpanecontainer.add(taskpane);

  // set the transparency of the JXPanel to 50% transparent
  panel.setAlpha(0.7f);

  panel.add(taskpanecontainer, BorderLayout.CENTER);
  panel.setPreferredSize(new Dimension(250, 200));

  return panel;
}
View Full Code Here


    protected Insets getCaptionInsets() {
      return UIManager.getInsets("JXTitledPanel.captionInsets");
    }
   
    protected JXPanel createAndConfigureTopPanel(JXTitledPanel titledPanel) {
        JXPanel topPanel = new JXPanel();
        topPanel.setBackgroundPainter(titledPanel.getTitlePainter());
        topPanel.setBorder(BorderFactory.createEmptyBorder());
        topPanel.setLayout(new GridBagLayout());
        topPanel.setOpaque(false);
        return topPanel;
    }
View Full Code Here

        // //TODO add image
        // add(panel4);
    }

    private JXPanel createFirstCard() {
        JXPanel control = new JXPanel();
        FormLayout formLayout = new FormLayout(
                "5dlu, r:d:n, l:4dlu:n, f:d:g", // columns
                "c:d:n " +
                ", t:4dlu:n, c:d:n " +
                ", t:4dlu:n, c:d:n" +
View Full Code Here

        return control;
    }
   
   
    private JComponent createThirdCard() {
        JComponent thirdCard = new JXPanel();
        thirdCard.add(new
                JXLabel("The quick brown fox\n jumped over the lazy dog."));
        return thirdCard;
    }
View Full Code Here

        return thirdCard;
    }
   
   
    private JXPanel createSecondCard() {
        JXPanel content = new JXPanel();
        content.add(new JButton("Button 1"));
        content.add(new JButton("Button 2"));
        content.add(new JButton("Button 3"));
        return content;
    }
View Full Code Here

    @SuppressWarnings("unused")
    private static final Logger LOG = Logger
            .getLogger(LoadedPanelExperiments.class.getName());
   
    private JComponent createSplitPane() {
        final JComponent demoContainer = new JXPanel();
        demoContainer.setLayout(new BorderLayout()); //BoxLayout(demoContainer, BoxLayout.LINE_AXIS));
        demoContainer.setBorder(BorderFactory.createLineBorder(Color.RED));
       
//      <snip> MultiSplit layout declaration
        String layout =
            "(ROW " +
                 "(LEAF name=selector weight=0.3)" +
View Full Code Here

        return splitPane;
    }


    private JComponent createPlainContent() {
        final JComponent demoContainer = new JXPanel(new BorderLayout());
        demoContainer.setBorder(BorderFactory.createLineBorder(Color.RED));
        JComponent splitPane = new JXPanel(new BorderLayout());
        splitPane.add(createButtonStack(demoContainer), BorderLayout.WEST);
        splitPane.add(demoContainer);
        return splitPane;
    }
View Full Code Here

    private void initComponents(Demo demo) throws Exception {
        URL description = demo.getHTMLDescription();
        if (description != null) {
            descriptionArea = createDescriptionArea(description);
        }
        demoPanel = new JXPanel(new BorderLayout());
        demoPanel.add(demo.createDemoComponent());
    }
View Full Code Here

    private void initComponents() {
        treeTable = new JXTreeTable();
        treeTable.setName("componentTreeTable");
        add(new JScrollPane(treeTable));

        JComponent control = new JXPanel();
        refreshButton = new JButton();
        refreshButton.setName("refreshButton");

        expandButton = new JButton();
        expandButton.setName("expandTreeTableButton");
       
        collapseButton = new JButton();
        collapseButton.setName("collapseTreeTableButton");
       
//        control.add(refreshButton);
        control.add(expandButton);
        control.add(collapseButton);
        add(control, BorderLayout.SOUTH);

    }
View Full Code Here

        tree = new JXTree();
        tree.setName("componentTree");
        tree.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
        add(new JScrollPane(tree), BorderLayout.CENTER);
       
        JComponent control = new JXPanel();
        refreshButton = new JButton();
        refreshButton.setName("refreshButton");

        expandButton = new JButton();
        expandButton.setName("expandButton");
       
        collapseButton = new JButton();
        collapseButton.setName("collapseButton");
       
//        control.add(refreshButton);
        control.add(expandButton);
        control.add(collapseButton);
        add(control, BorderLayout.SOUTH);
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.swingx.JXPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.