javax.swing.JButton#repaint ( )源码实例Demo

下面列出了javax.swing.JButton#repaint ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

static void repaintTest() {
    try {
        SwingUtilities.invokeAndWait(new Runnable() {
          @Override
            public void run() {
                test = new JButton();
                test.setSize(100, 100);
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
    } 
    // repaint(Rectangle) should be ok
    test.repaint(test.getBounds());
    test.repaint(0, 0, 100, 100);
    test.repaint();
}
 
public void actionPerformed(ActionEvent e) {
    JDialog notesDialog = new FractionNotesDialog(parentFrame, true, fraction);
    notesDialog.setLocation(parentFrame.getX() + 500, parentFrame.getY() + 50);
    notesDialog.setVisible(true);
    JButton tempJB = (JButton) e.getSource();
    tuneNotesButton(tempJB, ((UPbFraction) fraction).getFractionNotes());
    tempJB.repaint();
}
 
public void actionPerformed(ActionEvent e) {
    JDialog notesDialog = new FractionNotesDialog(parentFrame, true, fraction);
    notesDialog.setLocation(parentFrame.getX() + 500, parentFrame.getY() + 50);
    notesDialog.setVisible(true);
    JButton tempJB = (JButton) e.getSource();
    tuneNotesButton(tempJB, ((UPbFractionI) fraction).getFractionNotes());
    tempJB.repaint();
}
 
源代码4 项目: ET_Redux   文件: UPbFractionTableModel.java
@Override
public void actionPerformed(ActionEvent e) {
    JDialog notesDialog = new FractionNotesDialog(parentFrame, true, fraction);
    notesDialog.setLocation(parentFrame.getX() + 350, parentFrame.getY() + 350);
    notesDialog.setVisible(true);
    JButton tempJB = (JButton) e.getSource();
    tuneNotesButton(tempJB, fraction.getFractionNotes());
    tempJB.repaint();
}
 
源代码5 项目: CodenameOne   文件: SamplesPanel.java
private void preventDoubleClick(JButton btn) {
    btn.setEnabled(false);
    btn.repaint();
    javax.swing.Timer timer = new javax.swing.Timer(5000, e->{
       btn.setEnabled(true);
       btn.repaint();
    });
    timer.start();
}