Javatpoint Logo
Javatpoint Logo

JOGL Frame using AWT

AWT (Abstract Window Toolkit) is an application programming interface used to develop window-based applications. The components provided by AWT are heavy weight and platform dependent. The java.awt package contains various AWT classes for API's.

AWT (Abstract Window Toolkit) is an application programming interface used to develop window-based applications. The components provided by AWT are heavy weight and platform dependent. The java.awt package contains various AWT classes for API's.

Now, we will create a simple frame using the classes of JOGL with AWT by using the below steps: -

  • Follow, the basic structure of JOGL discussed in the previous page.
  • Create a frame using Frame class of AWT. To use this class, it is required to import java.awt package.
  • Now, add the object of GLCanvas class with the Frame class object using add() method.
  • Provide the required dimensions within the setSize() method and make the frame visibility true.

JOGL Frame Example

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

AWTFrame.java

Output:


JOGL Frame using AWT Output




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA