示例#1
0
 public Component getListCellRendererComponent(
     JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
   JComponent c =
       (JComponent)
           render.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
   c.setBorder(null);
   JCheckBox lab = new JCheckBox();
   ListElement le = (ListElement) value;
   // if("r1-print".equals(le.getCategory()))
   //
   // lab.setIcon(ResourceManager.getIcon(com.kingdee.bos.ctrl.report.forapp.kdnote.client.ui.NoteFileDialogEx.class, "res.r1_print.gif"));
   // else
   //
   // lab.setIcon(ResourceManager.getIcon(com.kingdee.bos.ctrl.report.forapp.kdnote.client.ui.NoteFileDialogEx.class, "res/empty.gif"));
   lab.setSelected(le.isSelected());
   lab.setOpaque(true);
   lab.setBackground(c.getBackground());
   TableLayout tl = TableLayout.splitCol(2);
   tl.colStyle(0).setWidth(22);
   tl.colStyle(1).setPriX(1);
   KDPanel pan = new KDPanel(tl);
   pan.add(lab, tl.cell(0));
   pan.add(c, tl.cell(1));
   return pan;
 }
示例#2
0
  /** Constructs a Level with no label */
  public Level() {
    draw = new LevelDraw();
    label = new JLabel("interface", JLabel.CENTER);

    TableLayout table = new TableLayout();
    this.setLayout(table);
    this.add("0 0 ", draw);
    this.add("0 1 hH", label);

    Vector v = new Vector(2);
    v.addElement(draw);
    v.addElement(label);
    table.sameWidth(v);
  }