APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.backends.lwjgl

public Class LwjglFrame

extends JFrame
Class Inheritance
Imports
java.io.PrintWriter, .StringWriter, javax.swing.JFrame, org.lwjgl.opengl.Display, com.badlogic.gdx.ApplicationListener, java.awt.Cursor, .Dimension, .EventQueue, .GraphicsConfiguration, .Point, java.awt.event.WindowAdapter, .WindowEvent, java.awt.geom.AffineTransform

Wraps an LwjglCanvas in a resizable JFrame.

Field Summary

Modifier and TypeField and Description
pack-priv LwjglCanvas
private Thread
Inherited from javax.swing.JFrame:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
LwjglFrame(ApplicationListener listener, String title, int width, int height)

public
public

Method Summary

Modifier and TypeMethod and Description
protected void
addCanvas()

Adds the canvas to the content pane.

protected void
applyCursor(Cursor cursor)

Called to set the cursor.

private void
public LwjglInput
protected void
protected void
disposed()

Called after dispose is complete.

protected void
protected int
public LwjglCanvas
protected void
initialize()

Called before the JFrame is made displayable.

protected void
public void
reshape(int x, int y, int width, int height)

Overrides java.awt.Window.reshape.

Reshapes the bounding rectangle for this component.

public void
setHaltOnShutdown(boolean halt)

When true, Runtime.getRuntime().halt(0); is used when the JVM shuts down.

protected void
start()

Called after ApplicationListener create and resize, but before the game loop iteration.

public void
updateSize(int width, int height)

Called when the canvas size changes.

Inherited from javax.swing.JFrame:
addImplcreateRootPaneframeInitgetAccessibleContextgetContentPanegetDefaultCloseOperationgetGlassPanegetGraphicsgetJMenuBargetLayeredPanegetRootPanegetTransferHandlerisDefaultLookAndFeelDecoratedisRootPaneCheckingEnabledparamStringprocessWindowEventremoverepaintsetContentPanesetDefaultCloseOperationsetDefaultLookAndFeelDecoratedsetGlassPanesetIconImagesetJMenuBarsetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdate

Field Detail

lwjglCanvasback to summary
pack-priv LwjglCanvas lwjglCanvas
shutdownHookback to summary
private Thread shutdownHook

Constructor Detail

LwjglFrameback to summary
public LwjglFrame(ApplicationListener listener, String title, int width, int height)
LwjglFrameback to summary
public LwjglFrame(ApplicationListener listener, LwjglApplicationConfiguration config)
LwjglFrameback to summary
public LwjglFrame(ApplicationListener listener, LwjglApplicationConfiguration config, GraphicsConfiguration graphicsConfig)
Parameters
graphicsConfig:GraphicsConfiguration

May be null.

Method Detail

addCanvasback to summary
protected void addCanvas()

Adds the canvas to the content pane. This triggers addNotify and starts the canvas' game loop.

applyCursorback to summary
protected void applyCursor(Cursor cursor)

Called to set the cursor.

constructback to summary
private void construct(ApplicationListener listener, LwjglApplicationConfiguration config)
createInputback to summary
public LwjglInput createInput(LwjglApplicationConfiguration config)
creatingback to summary
protected void creating()
disposedback to summary
protected void disposed()

Called after dispose is complete.

exceptionback to summary
protected void exception(Throwable ex)
getFrameRateback to summary
protected int getFrameRate()
getLwjglCanvasback to summary
public LwjglCanvas getLwjglCanvas()
initializeback to summary
protected void initialize()

Called before the JFrame is made displayable.

postedExceptionback to summary
protected void postedException(Throwable ex, Throwable caller)
reshapeback to summary
public void reshape(int x, int y, int width, int height)

Overrides java.awt.Window.reshape.

Doc from java.awt.Component.reshape.

Reshapes the bounding rectangle for this component.

setHaltOnShutdownback to summary
public void setHaltOnShutdown(boolean halt)

When true, Runtime.getRuntime().halt(0); is used when the JVM shuts down. This prevents Swing shutdown hooks from causing a deadlock and keeping the JVM alive indefinitely. Default is true.

startback to summary
protected void start()

Called after ApplicationListener create and resize, but before the game loop iteration.

updateSizeback to summary
public void updateSize(int width, int height)

Called when the canvas size changes.