drawRect « Development « Java Swing Q&A





1. drawRect()    coderanch.com

Hi, I'm having trouble using the drawRect method. I'm using a JTabbedPane which calls the class FamilyTree which in turn calls the RectanglesCanvas class, not sure what i'm doing wrong. Thanks. import javax.swing.JTabbedPane; import javax.swing.ImageIcon; import javax.swing.JFrame; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TabbedPaneDemo extends JApplet { public static Color on = new Color(255,204,153); public static Color off = ...

2. drawRect() issues    coderanch.com

got a quick question if anyone can answer it. I want the drawRect(int,int,int,int) method to draw a rect in from one point to the next point. The problem is that drawRect() only draws from the topLeft corner of the screen to the bottomRight corner of the screen. If you try to draw it another way, it doesent work. Here is my ...