frame.setTitle("Welcome to " + Tools.APP_TITLE + " " + Tools.APP_VERSION);
// Load logo
try {
SimpleImage img = getImage(Tools.SPECIAL_VERSION ? "logo_special.png" : "logo.png");
northPanel.setLayout(null);
ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
imgPanel.setPreferredSize(new Dimension(img.getImageWidth(), img.getImageHeight()));
imgPanel.setLocation(Tools.SPECIAL_VERSION ? 7 : 107, 4);
getNorthPanel().add(imgPanel);
}
catch (Exception ex) {
ex.printStackTrace();
}
String imageFilename = "";
try {
if (Tools.SPECIAL_VERSION) {
final int IMG_COUNT = 3;
int imageIdx = (int) (Math.random() * IMG_COUNT) + 1;
String id = String.valueOf(imageIdx);
while (id.length() < 3) {
id = "0" + id;
}
imageFilename = "special" + id + ".jpg";
}
else {
final int IMG_COUNT = 101;
int imageIdx = (int) (Math.random() * IMG_COUNT) + 1;
String id = String.valueOf(imageIdx);
while (id.length() < 3) {
id = "0" + id;
}
imageFilename = "image" + id + ".jpg";
}
SimpleImage img = getImage(imageFilename);
imgDisplayPanel.setLayout(null);
ImagePanel imgPanel = new ImagePanel(img, 0, 0, img.getImageWidth());
getImgDisplayPanel().add(imgPanel);
// System.out.println(imgDisplayPanel.getSize().height + " " + imgDisplayPanel.getSize().width);
imgPanel.setLayout(null);
}
catch (Throwable ex) {
System.out.println(imageFilename);
ex.printStackTrace();
}