Javatpoint Logo
Javatpoint Logo

JOGL Frame using Swing

Swing is a light-weight graphical user interface toolkit used to develop window-based applications. The java.swing package provide various classes for swing API.

Now, we will create a simple frame using Canvas with swing by using following steps: -

  • Follow, the basic structure of JOGL.
  • Create a frame using JFrame class of swing.
  • Now, add the object of GLCanvas class with the JFrame class object using add() method.
  • Provide the required dimensions within the setSize() method and make the frame visibility true.

Example of JOGL Frame

In this example, we will create a simple JOGL frame using swing.

SwingFrame.java

Output:


JOGL Frame using Swing Output
Next TopicJOGL Primitives





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA