1. JDesktopPane Graphics coderanch.comimport javax.swing.*; import java.awt.*; class GTest { public static void main( String[] args ) { int x = 0, y = 0, xend = 100, yend = 100; JFrame f = new JFrame(); f.setSize( 200, 200 ); JDesktopPane desktop = new JDesktopPane(); f.getContentPane().add( desktop ); f.setVisible( true ); Graphics g = desktop.getGraphics(); System.out.println("g = " + g); g.drawLine(x,y,xend,yend); } } |