Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Draw on JPanel
#2
My apologies for the delay. As far as drawing on a JPanel goes, you would need to follow the standard procedure of all Canvas-esque Java objects.

1) Get the graphics object of the JPanel
2) Create the object you want to draw
3) Have the graphics object draw that object

These pages may help you:
<!-- m --><a class="postlink" href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JPanel.html">http://docs.oracle.com/javase/7/docs/ap ... Panel.html</a><!-- m -->

<!-- m --><a class="postlink" href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.html#getGraphics(">http://docs.oracle.com/javase/7/docs/ap ... tGraphics(</a><!-- m -->)

<!-- m --><a class="postlink" href="http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html">http://docs.oracle.com/javase/7/docs/ap ... phics.html</a><!-- m -->
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Draw on JPanel - by yomarius95 - 04-10-2014, 03:55 AM
Re: Draw on JPanel - by brandonio21_phpbb3_import2 - 06-17-2014, 12:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)