![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Ok how does one draw a simple line in java.. import java.awt.*; class AvinLine Ok how do i draw the line without creating another class .. and the JPanel and JFrame must be in the same class.. I am trying to avoid making a new clas that extends JPanel. I do not want to add another class. The line must be added within this class. And i am also trying to avoid the "paint(Graphics g)" method. Is there anyway to add the line to the JPanel and then add the panel to the JFrame. Because I find it dificult to believe that Java is such a powerful language that you have to call a "paint(Graphics g)" method and create another class just to draw a simple line. Thanks for the help in advance..
Replies: |
Sponsored Links
|