/** Creates an image of the checkbox and puts it in a label. */
 private JLabel createIconLabel(JCheckBox checkBox) {
   checkBox.setOpaque(false);
   checkBox.setSize(checkBox.getMinimumSize());
   Image image =
       new BufferedImage(checkBox.getWidth(), checkBox.getHeight(), Transparency.TRANSLUCENT);
   Graphics g = image.getGraphics();
   checkBox.paint(g);
   g.dispose();
   return new JLabel(new ImageIcon(image));
 }
예제 #2
0
파일: ChannelView.java 프로젝트: usgs/xmax
 public void paint(Graphics g) {
   // if(!isPaintingForPrint()){ //works only in jre 1.6
   super.paint(g);
   // }
 }