can you show me how to draw a single line
Create a class that extends JPanel, override the paintComponent method,
add a call to the Graphics drawLine() to the paint method, add the panel to your GUI where you want to see the line.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
There must be code samples here on the Forum or Google.
Have you tried Searching here for drawLine?
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
The "panel" refers to the class that extends JPanel. You add an instance of that class to a container in your GUI.
"Where you want to see the line" is the location on your GUI where you want to see the line.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656