runelite-client/src/main/java/net/runelite/client/ui/ClientUI.java
/**
	 * Initialize UI.
	 *
	 * @param client the client
	 * @throws Exception exception that can occur during creation of the UI
	 */
Initialize UI.
@param client the client
@throws Exception exception that can occur during creation of the UI
Initialize UI . @param client the client @throws Exception exception that can occur during creation of the UI
public void init(@Nullable final Applet client) throws Exception
	{
		this.client = client;
		SwingUtilities.invokeAndWait(() ->
		{
			SwingUtil.setupDefaults();
			SwingUtil.setTheme(new SubstanceGraphiteLookAndFeel());
			SwingUtil.setFont(FontManager.getRunescapeFont());
			frame = new ContainableFrame();
			OSXUtil.tryEnableFullscreen(frame);
			frame.setTitle(properties.getTitle());
			frame.setIconImage(ICON);
			frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); 
			frame.setLocationRelativeTo(frame.getOwner());
			frame.setResizable(true);
			SwingUtil.addGracefulExitCallback(frame,
				() ->
				{
					saveClientBoundsConfig();
					runelite.shutdown();
				},
				() -> client != null
					&& client instanceof Client
					&& ((Client) client).getGameState() != GameState.LOGIN_SCREEN);
			container = new JPanel();
			container.setLayout(new BoxLayout(container, BoxLayout.X_AXIS));
			container.add(new ClientPanel(client));
			navContainer = new JPanel();
			navContainer.setLayout(new BorderLayout(0, 0));
			navContainer.setMinimumSize(new Dimension(0, 0));
			navContainer.setMaximumSize(new Dimension(0, Integer.MAX_VALUE));
			container.add(navContainer);
			pluginToolbar = new ClientPluginToolbar();
			titleToolbar = new ClientTitleToolbar();
			frame.add(container);
			final UiKeyListener uiKeyListener = new UiKeyListener(this);
			frame.addKeyListener(uiKeyListener);
			keyManager.registerKeyListener(uiKeyListener);
		});
	}
public void init ( @ Nullable final Applet client ) throws Exception { this . client = client ; SwingUtilities . invokeAndWait ( ( ) -> { SwingUtil . setupDefaults ( ) ; SwingUtil . setTheme ( new SubstanceGraphiteLookAndFeel ( ) ) ; SwingUtil . setFont ( FontManager . getRunescapeFont ( ) ) ; frame = new ContainableFrame ( ) ; OSXUtil . tryEnableFullscreen ( frame ) ; frame . setTitle ( properties . getTitle ( ) ) ; frame . setIconImage ( ICON ) ; frame . getLayeredPane ( ) . setCursor ( Cursor . getDefaultCursor ( ) ) ; frame . setLocationRelativeTo ( frame . getOwner ( ) ) ; frame . setResizable ( true ) ; SwingUtil . addGracefulExitCallback ( frame , ( ) -> { saveClientBoundsConfig ( ) ; runelite . shutdown ( ) ; } , ( ) -> client != null && client instanceof Client && ( ( Client ) client ) . getGameState ( ) != GameState . LOGIN_SCREEN ) ; container = new JPanel ( ) ; container . setLayout ( new BoxLayout ( container , BoxLayout . X_AXIS ) ) ; container . add ( new ClientPanel ( client ) ) ; navContainer = new JPanel ( ) ; navContainer . setLayout ( new BorderLayout ( 0 , 0 ) ) ; navContainer . setMinimumSize ( new Dimension ( 0 , 0 ) ) ; navContainer . setMaximumSize ( new Dimension ( 0 , Integer . MAX_VALUE ) ) ; container . add ( navContainer ) ; pluginToolbar = new ClientPluginToolbar ( ) ; titleToolbar = new ClientTitleToolbar ( ) ; frame . add ( container ) ; final UiKeyListener uiKeyListener = new UiKeyListener ( this ) ; frame . addKeyListener ( uiKeyListener ) ; keyManager . registerKeyListener ( uiKeyListener ) ; } ) ; }
Initialize UI.
Initialize UI .
// Set some sensible swing defaults // Use substance look and feel // Use custom UI font // Create main window // Try to enable fullscreen on OSX // Prevent substance from using a resize cursor for pointing // Add key listener