Java Code Examples for javax.swing.JFrame.validate()

The following are Jave code examples for showing how to use validate() of the javax.swing.JFrame class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: jOthelloT   File: OthelloTournament.java   View Source Code Vote up 7 votes
public void saveGameRecord(JFrame frame, String competidores, PvpScore pvpScore) {
    try {
        frame.validate();
        frame.repaint();            
        Container c = frame.getContentPane();
        c.validate();
        c.repaint();
        BufferedImage im = new BufferedImage(c.getWidth(), c.getHeight(), BufferedImage.TYPE_INT_ARGB);
        c.paint(im.getGraphics());
        pvpScore.setGameRecord(im);
    } catch (Exception ex) {
        Logger.getLogger(OthelloTournament.class
                .getName()).log(Level.SEVERE, null, ex);
    }
}