rowlf cleanup

This commit is contained in:
Downforce Agent 2024-07-12 13:50:00 -05:00
parent aa5d4bb97f
commit 0699bc3644
4 changed files with 29 additions and 7 deletions

View File

@ -366,7 +366,7 @@ public class MissPiggy implements ActionListener {
}
} else
if (actionEvent.getSource() == helpMenu.getItem(5)) {StartErnie();} else
if (actionEvent.getSource() == helpMenu.getItem(6)) {new Rowlf().displayAboutScreen();}
if (actionEvent.getSource() == helpMenu.getItem(6)) {new Rowlf();}
}
// Will likely split the below functions into separate classes to work with intellij GUI designer.

View File

@ -5,16 +5,22 @@
<constraints>
<xy x="20" y="20" width="1464" height="573"/>
</constraints>
<properties/>
<properties>
<background color="-15128227"/>
<font name="Exo 2"/>
<foreground color="-526337"/>
</properties>
<border type="none"/>
<children>
<component id="a5cc7" class="javax.swing.JLabel" binding="picLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false">
<maximum-size width="-1" height="100"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false">
<maximum-size width="333" height="100"/>
</grid>
</constraints>
<properties>
<font name="Exo 2"/>
<foreground color="-592129"/>
<text value="Aww fiddlesticks, what now?"/>
</properties>
</component>
@ -26,6 +32,11 @@
</grid>
</constraints>
<properties>
<background color="-16777216"/>
<editable value="false"/>
<focusable value="false"/>
<font name="Fusion" size="10"/>
<foreground color="-5180417"/>
<horizontalAlignment value="0"/>
<text value="Do you think we should appeal to the alien authorities?"/>
</properties>
@ -38,6 +49,8 @@
</grid>
</constraints>
<properties>
<font name="Exo 2"/>
<foreground color="-592129"/>
<text value="Version Unknown"/>
</properties>
</component>
@ -49,6 +62,8 @@
</grid>
</constraints>
<properties>
<font name="Exo 2"/>
<foreground color="-592129"/>
<text value="Platform Unknown"/>
</properties>
</component>

View File

@ -26,21 +26,28 @@ import java.io.IOException;
import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE;
public class Rowlf {
private BufferedImage windowIcon;
JFrame frame = new JFrame();
JPanel frameContainer;
BufferedImage logo;
Image logo;
JLabel picLabel;
private JTextField informationText;
private JLabel versionLabel;
private JLabel environmentLabel;
public void displayAboutScreen() {
public Rowlf() {
try {
logo = ImageIO.read(Main.class.getResourceAsStream("/logo_about.png"));
logo = ImageIO.read(Main.class.getResourceAsStream("/logo.png")).getScaledInstance(333, 100, Image.SCALE_SMOOTH);
} catch (IOException e) {
System.out.println("ERROR: Failed to open About screen because we couldn't find an image needed to display the page.");
throw new RuntimeException(e);
}
try {
windowIcon = ImageIO.read(Main.class.getResourceAsStream("/titleIcon.png"));
frame.setIconImage(windowIcon);
} catch (IOException e) {
System.out.println("ERROR: Failed to find /resources/titleIcon.png. Window will not have an icon.");
}
//frame.add(picLabel);
frame.add(frameContainer); // initialize window contents -- will be handled by IntelliJ IDEA

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB