Java – Set the Size of a FrameView programmatically

This code snip creates a jFrame object and sets it to maximum dimensions before setting the startup frame equal to it.  I tried the direct one liner method but this did not work.  It thwarted me time after time.

[java]<br />
&lt;/p&gt;
</p>

<p>
&lt;p&gt;<br />
super(app);&lt;br /&gt;<br />
JFrame frame = new JFrame();&lt;br /&gt;<br />
frame.pack();&lt;br /&gt;<br />
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);&lt;br /&gt;<br />
frame.setResizable(false);&lt;br /&gt;<br />
this.setFrame(frame);&lt;br /&gt;<br />
initComponents();<br />
&lt;/p&gt;
</p>

<p>
&lt;p&gt;<br />
[/java]

WordPress PlugIn: Syntax HighLighter hilites your code snips

The original creators page is here. <pre class="brush: php; highlight: [5, 15]; html-script: true"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>SyntaxHighlighter Demo Page – <?= htmlspecialchars($title) ?></title> </head> <body> <? /*********************************** ** Multiline block comments **********************************/ $stringWithUrl = Read more…