Simple Java 2D graphics: draw a rectangle?

To draw a rectangle in Swing you should: First of all, never draw directly in the JFrame or other top-level window. Instead draw in a JPanel, JComponent or other class that eventually extends from JComponent. You should override the paintComponent(Graphics g) method. You should be sure to call the super method You should draw your rectangle with … Read more

Difference between java.exe and javaw.exe

java.exe is the command where it waits for application to complete untill it takes the next command. javaw.exe is the command which will not wait for the application to complete. you can go ahead with another commands.