View Single Post
  #1 (permalink)  
Old 03-25-2008, 09:23 PM
Lang Lang is offline
Member
 
Join Date: Nov 2007
Posts: 8
Lang is on a distinguished road
Trying to use Graphics draw methods
I'm having trouble drawing simple graphics.

This is in my Shuffleboard class
Code:
Board board = new Board("Shuffleboard"); board.setLocation(100, 100); board.setResizable(false); board.setVisible(true);
This is in my Board class
Code:
boardCanvas = new BoardCanvas(); this.add(boardCanvas);
This is in my BoardCanvas class
Code:
super.paintComponent(g); g.setColor(Color.black); for (Weight w : weights){ g.fillOval(200, 200, 50, 50); //g.drawString("Test", 100, 100); System.out.println("Bleh"); }
I know its executing because it is printing Bleh to the console. But no oval is being drawn. There appears to be no error.

My BoardCanvas class extends JPanel - and my Shuffleboard class extends JFrame. Would this be an issue?

Any help is appreciated,
Lang
Reply With Quote
Sponsored Links