Package dan.swing

Examples of dan.swing.JPrettyLabel


        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus) {

      JPrettyLabel label = (JPrettyLabel)super.getListCellRendererComponent(
          list, value, index, isSelected, cellHasFocus);

      //pad five pixels on left and right:
        label.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));

        label.setOpaque(false);
        if (value instanceof GroupElement) {
          label.setBorder(BorderFactory.createLineBorder(Color.GRAY));
          label.setBackgroundPainter(groupPainter);
          label.setFont(label.getFont().deriveFont(Font.BOLD));
        }

        if (isSelected) {
          label.setBackgroundPainter(selectedPainter);
          label.setForeground(Color.WHITE);
          label.setFont(label.getFont().deriveFont(Font.ITALIC));
        }

        return label;
    }
View Full Code Here


        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus) {

      JPrettyLabel label = (JPrettyLabel)super.getListCellRendererComponent(
          list, value, index, isSelected, cellHasFocus);

      //pad five pixels on left and right:
      label.setBorder(BorderFactory.createEmptyBorder(0,5,0,5));

      label.setOpaque(false);
      if (value instanceof GroupElement) {
        label.setBorder(BorderFactory.createLineBorder(Color.GRAY));
        label.setBackgroundPainter(groupPainter);
        label.setFont(label.getFont().deriveFont(Font.BOLD));
      }

      if (isSelected) {
        label.setBackgroundPainter(selectedPainter);
        label.setForeground(Color.WHITE);
        label.setFont(label.getFont().deriveFont(Font.ITALIC));
      }

      return label;
    }
View Full Code Here

  protected void init() {
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

    pnlHeader = new JPanel(new FlowLayout(FlowLayout.LEFT));
    lblHeader = new JPrettyLabel();
    pnlHeader.add(lblHeader);
    AppStyles.applyStyle(lblHeader, "TaskIconGroup Label.header");
    AppStyles.applyStyle(pnlHeader, "TaskIconGroup Panel.header");

    //flow layout that resizes with component:
View Full Code Here

TOP

Related Classes of dan.swing.JPrettyLabel

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.