JComboBox<String> languageComboBox = new JComboBox<>();
languageComboBox.setModel(new DefaultComboBoxModel<>(new String[]{"English", "Spanish", "German", "Chinese"})); // set model
languageComboBox.setToolTipText("Select language"); // tooltip
// background image and image map items
ImageMapLabel menuLabel = new ImageMapLabel();
menuLabel.setIcon(IOManager.getAsIcon(Places.GraphicsStartup, "start.background.jpg")); // set image
// add all icons
ActionListener editorAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
UIFrame frame = new EditorScreen();
frame.switchTo();
}
};
ActionListener helpAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
URL index = IOManager.getURL(Places.Help, "en_index.html");
BrowserPanel browser = new BrowserPanel(index, index, IOManager.getAsLoader(Places.GraphicsBrowserIcons), IOManager.getAsImage(Places.GraphicsIcons, "misc/dialog.background.png"));
UIDialog.make(browser, "Help");
}
};
menuLabel.addMapItem(new Rectangle(421, 459, 110, 90), new Point(421, 459), "Game Center", IOManager.getAsImage(Places.GraphicsStartup, "start.overlay.throne.png"), new UIDialogStartAction(GameCenterDialog.class));
menuLabel.addMapItem(new Rectangle(821, 60, 200, 375), new Point(821, 60), "Editor", IOManager.getAsImage(Places.GraphicsStartup, "start.overlay.map.png"), editorAction);
menuLabel.addMapItem(new Rectangle(575, 412, 70, 140), new Point(575, 412), "Exit", IOManager.getAsImage(Places.GraphicsStartup, "start.overlay.door.right.png"), StartClient.ExitAction);
menuLabel.addMapItem(new Rectangle(832, 505, 65, 130), new Point(832, 505), "Preferences", IOManager.getAsImage(Places.GraphicsStartup, "start.overlay.fireplace.png"), new UIDialogStartAction(OptionsDialog.class));
menuLabel.addMapItem(new Rectangle(127, 397, 130, 130), new Point(127, 397), "Help", IOManager.getAsImage(Places.GraphicsStartup, "start.overlay.window.left.png"), helpAction);
// Version label
JLabel versionLabel = new JLabel("Version " + Option.General_Version.get());
versionLabel.setForeground(Color.WHITE); // white color