Пример #1
0
 // ------------------------------------------------------------------------------------------------
 // 描述:
 // 设计: Skyline(2001.12.29)
 // 实现: Skyline
 // 修改:
 // ------------------------------------------------------------------------------------------------
 void InitButton() {
   JColorButton bn;
   Insets is;
   Color clr;
   is = new Insets(0, 0, 0, 0);
   for (int Row = 0; Row < 7; Row++) {
     for (int Col = 0; Col < 8; Col++) {
       clr =
           new Color(
               ColorConstants.colors[Row * 7 + Col][0],
               ColorConstants.colors[Row * 7 + Col][1],
               ColorConstants.colors[Row * 7 + Col][2]);
       bn = new JColorButton(clr);
       bn.addActionListener(this);
       bn.setText("");
       bn.setMargin(is);
       jPanel3.add(bn, null);
     }
   }
 }
Пример #2
0
 // ------------------------------------------------------------------------------------------------
 // 描述:
 // 设计: Skyline(2001.12.29)
 // 实现: Skyline
 // 修改:
 // ------------------------------------------------------------------------------------------------
 private void jbInit() throws Exception {
   bnAutoColor.setFont(new java.awt.Font("Dialog", 0, 12));
   bnAutoColor.setActionCommand("bnAutoColor");
   bnAutoColor.setText(res.getString("String_3"));
   jPanel1.setLayout(borderLayout1);
   jPanel3.setLayout(gridLayout1);
   gridLayout1.setColumns(8);
   gridLayout1.setRows(7);
   jPanel2.setLayout(borderLayout2);
   this.getContentPane().add(jPanel1, BorderLayout.CENTER);
   jPanel1.add(jPanel3, BorderLayout.CENTER);
   jPanel1.add(jPanel2, BorderLayout.NORTH);
   jPanel2.add(bnAutoColor, BorderLayout.CENTER);
   //    this.setDefaultCloseOperation();
   setSize(200, 220);
   setTitle(res.getString("String_4"));
   this.addWindowFocusListener(this);
   InitButton();
 }