¡@

Home 

java Programming Glossary: chesspiece

How do I make my custom Swing component visible?

http://stackoverflow.com/questions/4674268/how-do-i-make-my-custom-swing-component-visible

JLayeredPane layeredPane JPanel chessBoard JLabel chessPiece int xAdjustment int yAdjustment public ChessBoard Dimension.. so it can be moved public void mousePressed MouseEvent e chessPiece null Component c chessBoard.findComponentAt e.getX e.getY if.. e.getX yAdjustment parentLocation.y e.getY chessPiece JLabel c chessPiece.setLocation e.getX xAdjustment e.getY yAdjustment..

Does adding a JLabel to a JPanel “hide” the JPanel?

http://stackoverflow.com/questions/4687607/does-adding-a-jlabel-to-a-jpanel-hide-the-jpanel

PIECE_WIDTH DARK_PIECE_COLOR JLabel chessPiece new JLabel icon SwingConstants.CENTER jPanelSquareGrid 1 3 .add.. icon SwingConstants.CENTER jPanelSquareGrid 1 3 .add chessPiece MyMouseAdapter mouseAdapter new MyMouseAdapter mainLayeredPane.addMouseListener.. JPanel private int rank private int file private JLabel chessPiece null public JPanelSquare int rank int file Color bkgrnd this.rank..