Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DisplayGraphics1 extends Canvas{
- public void paint(Graphics g) {
- g.drawString("Hello",40,40);
- setBackground(Color.WHITE);
- }
- }
- public class LayeredTest extends Canvas implements GLEventListener{
- static DisplayGraphics1 m = new DisplayGraphics1();
- static final JFrame frame = new JFrame ( "Game" );
- public static void main( String[] args ) {
- //... creating glcanvas
- frame.getContentPane().add( glcanvas );
- frame.setSize( frame.getContentPane().getPreferredSize() );
- frame.setVisible( true );
- }
- @Override
- public void display( GLAutoDrawable drawable ) {
- if(clickedOnHighscore) { frame.getContentPane().add( m ); }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement