Examples of JXPanel


Examples of org.jdesktop.swingx.JXPanel

    private static final Font cardNameFont = new Font("Calibri", Font.BOLD, 15);
    private static final Insets DEFAULT_INSETS = new Insets(0, 0, 70, 25);
    private static final Insets COMPONENT_INSETS = new Insets(0, 0, 40, 40);

    public static JXPanel getDescription(CardView card, int width, int height) {
        JXPanel descriptionPanel = new JXPanel();

        //descriptionPanel.setAlpha(.8f);
        descriptionPanel.setBounds(0, 0,  width, height);
        descriptionPanel.setVisible(false);
        descriptionPanel.setLayout(null);

        //descriptionPanel.setBorder(BorderFactory.createLineBorder(Color.green));

        JButton j = new JButton("");
        j.setBounds(0, 0,  width, height);
        j.setBackground(Color.black);
        j.setLayout(null);

        JLabel cardText = new JLabel();
        cardText.setBounds(5, 5,  width - 10, height - 10);
        cardText.setForeground(Color.white);
        cardText.setFont(cardNameFont);
        cardText.setVerticalAlignment(SwingConstants.TOP);
        j.add(cardText);
      
        cardText.setText(getRulefromCardView(card).toString());

        descriptionPanel.add(j);

        return descriptionPanel;
    }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

      txtNotes.setName(ConfigEntityCollection.Config.NOTES.name);
    }
   
    private void addComponents() {
      setLayout(new FlowLayout(FlowLayout.LEFT));
      final JXPanel panel = new JXPanel();
      final GroupLayout groupLayout = new GroupLayout(panel);
      groupLayout.setAutoCreateGaps(true);
      groupLayout.setHorizontalGroup(
              groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                      .addComponent(lblDefaultRate)
                      .addComponent(lblDefaultReportDuration)
                      .addComponent(lblFrom)
                      .addComponent(lblTo)
                      .addComponent(lblNotes))
              .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                      .addComponent(txtDefaultRate)
                      .addComponent(txtDefaultReportDuration)
                      .addComponent(fromPane)
                      .addComponent(toPane)
                      .addComponent(notesPane))
      );
     
      groupLayout.setVerticalGroup(
              groupLayout.createSequentialGroup()
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(lblDefaultRate).addComponent(txtDefaultRate))
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(lblDefaultReportDuration).addComponent(txtDefaultReportDuration))
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(lblFrom).addComponent(fromPane))
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(lblTo).addComponent(toPane))
                        .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(lblNotes).addComponent(notesPane)));
     
      panel.setLayout(groupLayout);
      add(panel);
     
      // get value from config
      final ConfigEntityCollection config = ConfigEntityCollection.getInstance();
      txtDefaultRate.setText(config.getConfigEntity(txtDefaultRate.getName()).getValue());
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

public final class Util {
  private Util() {}
 
  public static JXPanel createPanel(final LayoutManager manager, final Component... components) {
    final JXPanel panel = new JXPanel();
    panel.setLayout(manager);
   
    for (final Component c : components) {
      panel.add(c);
    }
    return panel;
  }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

    }
    return panel;
  }
 
  public static JXPanel createBoxLayoutPanel(final int axis, final Component... components) {
    final JXPanel panel = new JXPanel();
    panel.setLayout(new BoxLayout(panel, axis));
   
    for (final Component c : components) {
      panel.add(c);
    }
    return panel;
  }
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

      txtInvoiceNo.setPreferredSize(new Dimension(120,20));
      txtInvoiceNo.setMaximumSize(new Dimension(200,20));
      txtInvoiceNo.setText(Util.ReverseDateFormat.format(new Date()));
    }
    private void addExportPanel() {
      final JXPanel datePanel = new JXPanel();
      final GroupLayout groupLayout = new GroupLayout(datePanel);
      groupLayout.setAutoCreateGaps(true);
      datePanel.setLayout(groupLayout);
      exportPanel.setLayout(new BoxLayout(exportPanel, BoxLayout.Y_AXIS));
      exportPanel.setBorder(BorderFactory.createTitledBorder("Export Timesheet"));
     
      final JLabel fromLabel = new JLabel("From");
      final JLabel toLabel = new JLabel("To");
      final JLabel invoiceLabel = new JLabel("Invoice No");
     
      groupLayout.setHorizontalGroup(
              groupLayout.createSequentialGroup()
              .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                  .addComponent(fromLabel)
                      .addComponent(toLabel))
              .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                  .addComponent(fromDate)
                      .addComponent(toDate)));
     
      groupLayout.setVerticalGroup(
              groupLayout.createSequentialGroup()
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(fromLabel).addComponent(fromDate))
                      .addGroup(groupLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                              .addComponent(toLabel).addComponent(toDate)));
     
      // from date is -x days from current date (x is defined in config)
      final Calendar c = Calendar.getInstance();
      c.setTime(fromDate.getDate());
      Integer days = Config.getDefaultReportDuration();
      if (days == null) {
        days = 0;
      }
      c.add(Calendar.DAY_OF_YEAR, -days);
      fromDate.setDate(c.getTime());
     
      datePanel.setAlignmentX(LEFT_ALIGNMENT);
      btnExport.setMnemonic('x');
      btnExport.setAlignmentX(LEFT_ALIGNMENT);
      chkSkipEmptyRecords.setMnemonic('s');
      chkSkipEmptyRecords.setAlignmentX(LEFT_ALIGNMENT);
      chkSkipEmptyRecords.setSelected(true);
View Full Code Here

Examples of org.jdesktop.swingx.JXPanel

    Util.setFixedSize(btnReset, new Dimension(100,30));
    Util.setFixedSize(btnMinimize, new Dimension(100,30));

    getRootPane().setDefaultButton(btnStart);

    final JXPanel top = new JXPanel();
    top.setLayout(new VerticalLayout(5));
    top.add(Util.createBoxLayoutPanel(BoxLayout.X_AXIS, btnStart, btnReset,
            Box.createHorizontalGlue(), chkUpdate, Box.createHorizontalGlue(), btnMinimize));
    top.add(Util.createBoxLayoutPanel(BoxLayout.X_AXIS, new JXLabel("Description: "),
            txtDescription));

    add(top, BorderLayout.NORTH);
    add(label);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.