public void mouseEntered(MouseEvent e) { JToggleButton btn = (JToggleButton) c; btn.setForeground(Color.red); btn.setBackground(Color.orange); Cursor cursor = Cursor.getPredefinedCursor(Cursor.HAND_CURSOR); btn.setCursor(cursor); }
public void addButton(JToggleButton b) { imagePanel.add(b); b.setForeground(Color.black); b.setBackground(Color.white); b.setFocusable(false); b.addMouseListener(new PopupMouseListener(b)); b.addActionListener(new PopupActionListener(b)); }
public void actionPerformed(ActionEvent e) { // String currentMessage = clientWindowFrame.massageField.getText(); // clientWindowFrame.massageField.setText(currentMessage+"/*" +((JButton) c).getText()+"*/"); JToggleButton btn = (JToggleButton) c; btn.setForeground(Color.black); btn.setBackground(Color.white); mouseMenu.setVisible(false); actionButton.setIcon(btn.getIcon()); actionButton.setToolTipText(btn.getToolTipText()); }
public void mouseExited(MouseEvent e) { JToggleButton btn = (JToggleButton) c; btn.setForeground(Color.black); btn.setBackground(Color.white); }