List of usage examples for javax.swing AbstractAction putValue
public void putValue(String key, Object newValue)
Value
associated with the specified key. From source file:tvbrowser.extras.reminderplugin.ReminderPlugin.java
protected static ActionMenu getButtonAction() { AbstractAction action = new AbstractAction() { public void actionPerformed(ActionEvent evt) { getInstance().showManageRemindersDialog(); }/*from w ww .j a v a 2 s . c om*/ }; action.putValue(Action.NAME, getName()); action.putValue(Action.SMALL_ICON, IconLoader.getInstance().getIconFromTheme("apps", "appointment", 16)); action.putValue(Plugin.BIG_ICON, IconLoader.getInstance().getIconFromTheme("apps", "appointment", 22)); action.putValue(Action.SHORT_DESCRIPTION, mLocalizer.msg("description", "Reminds you of programs to not miss them.")); return new ActionMenu(action); }
From source file:com.generalbioinformatics.rdf.gui.ProjectManager.java
private void refreshRecentFilesMenu() { for (int i = 0; i < MarrsPreference.RECENT_FILE_NUM; ++i) { AbstractAction act = recentActions[i]; RecentItem item = (i >= recentItems.size()) ? null : recentItems.get(i); if (item == null || item.file == null) { act.setEnabled(false);//from www .j av a 2s. c o m String menuTitle = i + ""; act.putValue(Action.NAME, menuTitle); act.putValue(Action.SHORT_DESCRIPTION, null); } else { act.setEnabled(true); String menuTitle = i + " - " + item.file.getName(); if (!StringUtils.emptyOrNull(item.title)) menuTitle += " - " + item.title; act.putValue(Action.NAME, menuTitle); act.putValue(Action.SHORT_DESCRIPTION, item.file.getAbsolutePath()); } } }
From source file:com.intuit.tank.proxy.ProxyApp.java
@SuppressWarnings("serial") public JMenuBar createMenu() { JMenuBar ret = new JMenuBar(); JMenu fileMenu = new JMenu("File"); JMenu sessionMenu = new JMenu("Session"); ret.add(fileMenu);//from www . j a va 2 s .c o m ret.add(sessionMenu); fileMenu.add(getMenuItem(openAction)); fileMenu.add(getMenuItem(saveAction)); fileMenu.addSeparator(); fileMenu.add(getMenuItem(filterAction)); fileMenu.add(getMenuItem(settingsAction)); fileMenu.addSeparator(); AbstractAction quitAction = new AbstractAction("Quit") { public void actionPerformed(ActionEvent arg0) { System.exit(0); } }; quitAction.putValue(javax.swing.Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_Q, keyMask)); quitAction.putValue(javax.swing.Action.MNEMONIC_KEY, KeyEvent.VK_Q); fileMenu.add(new JMenuItem(quitAction)); sessionMenu.add(getMenuItem(startAction)); sessionMenu.add(getMenuItem(stopAction)); sessionMenu.add(getMenuItem(pauseAction)); sessionMenu.addSeparator(); sessionMenu.add(getMenuItem(showHostsAction)); return ret; }
From source file:captureplugin.CapturePlugin.java
public ActionMenu getButtonAction() { AbstractAction action = new AbstractAction() { public void actionPerformed(ActionEvent evt) { showDialog();/* w w w. j a va 2 s . c o m*/ } }; action.putValue(Action.NAME, mLocalizer.msg("CapturePlugin", "Capture Plugin")); action.putValue(Action.SMALL_ICON, createImageIcon("mimetypes", "video-x-generic", 16)); action.putValue(BIG_ICON, createImageIcon("mimetypes", "video-x-generic", 22)); return new ActionMenu(action); }
From source file:idontwant2see.IDontWant2See.java
public ActionMenu getContextMenuActions(final Program p) { if (p == null) { return null; }// w w w .j a v a 2 s. c om // check if this program is already hidden final int index = getSearchTextIndexForProgram(p); // return menu to hide the program if (index == -1 || p.equals(getPluginManager().getExampleProgram())) { AbstractAction actionDontWant = getActionDontWantToSee(p); if (mSettings.isSimpleMenu() && !mCtrlPressed) { final Matcher matcher = PATTERN_TITLE_PART.matcher(p.getTitle()); if (matcher.matches()) { actionDontWant = getActionInputTitle(p, matcher.group(2)); } actionDontWant.putValue(Action.NAME, mLocalizer.msg("name", "I don't want to see!")); actionDontWant.putValue(Action.SMALL_ICON, createImageIcon("apps", "idontwant2see", 16)); return new ActionMenu(actionDontWant); } else { final AbstractAction actionInput = getActionInputTitle(p, null); final ContextMenuAction baseAction = new ContextMenuAction( mLocalizer.msg("name", "I don't want to see!"), createImageIcon("apps", "idontwant2see", 16)); return new ActionMenu(baseAction, new Action[] { actionDontWant, actionInput }); } } // return menu to show the program return new ActionMenu(getActionShowAgain(p)); }
From source file:org.geopublishing.atlasStyler.swing.AtlasStylerGUI.java
/** * This method initializes jToolBar// w w w . j ava 2 s . com * * @return javax.swing.JToolBar */ private JToolBar getJToolBar() { JToolBar jToolBar = new JToolBar(); jToolBar.setFloatable(false); AbstractAction importWiazrdAction = new AbstractAction( AtlasStylerVector.R("MenuBar.FileMenu.ImportWizard")) { @Override public void actionPerformed(ActionEvent e) { ImportWizard.showWizard(AtlasStylerGUI.this, AtlasStylerGUI.this); } }; importWiazrdAction.putValue(Action.LONG_DESCRIPTION, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK, true)); jToolBar.add(importWiazrdAction); jToolBar.add(getJTButtonShowXML()); jToolBar.add(getJTButtonExportAsSLD()); return jToolBar; }
From source file:userinterface.graph.SeriesEditorDialog.java
/** Creates new form GUIConstantsPicker */ private SeriesEditorDialog(GUIPlugin plugin, JFrame parent, JPanel graph, java.util.List<SeriesKey> series) { super(parent, "Graph Series Editor", true); this.plugin = plugin; this.editors = new ArrayList<SeriesEditor>(); initComponents();// w w w.jav a 2 s .c o m AbstractAction cut = new AbstractAction() { public void actionPerformed(ActionEvent e) { editors.get(tabbedPane.getSelectedIndex()).cut(); } }; cut.putValue(Action.LONG_DESCRIPTION, "Cut the current selection to the clipboard"); //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit"); cut.putValue(Action.NAME, "Cut"); cut.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCut.png")); //cut.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); AbstractAction copy = new AbstractAction() { public void actionPerformed(ActionEvent e) { editors.get(tabbedPane.getSelectedIndex()).copy(); } }; copy.putValue(Action.LONG_DESCRIPTION, "Copies the current selection to the clipboard"); //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit"); copy.putValue(Action.NAME, "Copy"); copy.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallCopy.png")); //copy.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); AbstractAction paste = new AbstractAction() { public void actionPerformed(ActionEvent e) { editors.get(tabbedPane.getSelectedIndex()).paste(); } }; paste.putValue(Action.LONG_DESCRIPTION, "Pastes the clipboard to the current selection"); //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit"); paste.putValue(Action.NAME, "Paste"); paste.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallPaste.png")); //paste.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); AbstractAction delete = new AbstractAction() { public void actionPerformed(ActionEvent e) { editors.get(tabbedPane.getSelectedIndex()).delete(); } }; delete.putValue(Action.LONG_DESCRIPTION, "Deletes the current"); //exitAction.putValue(Action.SHORT_DESCRIPTION, "Exit"); delete.putValue(Action.NAME, "Delete"); delete.putValue(Action.SMALL_ICON, GUIPrism.getIconFromImage("smallDelete.png")); for (SeriesKey key : series) { SeriesSettings settings = null; if (graph instanceof Graph) settings = ((Graph) graph).getGraphSeries(key); if (graph instanceof Histogram) settings = ((Histogram) graph).getGraphSeries(key); if (graph instanceof Graph3D) settings = ((Graph3D) graph).getSeriesSettings(); Object DataSeries = null; if (graph instanceof Graph) DataSeries = (PrismXYSeries) ((Graph) graph).getXYSeries(key); if (graph instanceof Histogram) DataSeries = ((Histogram) graph).getXYSeries(key); if (graph instanceof Graph3D) DataSeries = ((Graph3D) graph).getScatterSeries(); SeriesEditor editor = new SeriesEditor(graph, DataSeries, settings, cut, copy, paste, delete); editor.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); tabbedPane.addTab(settings.getSeriesHeading(), editor); editors.add(editor); } this.getRootPane().setDefaultButton(okayButton); toolBar.add(cut); toolBar.add(copy); toolBar.add(paste); toolBar.add(delete); this.add(toolBar, BorderLayout.NORTH); this.cancelled = false; super.setBounds(new Rectangle(550, 300)); setResizable(true); setLocationRelativeTo(getParent()); // centre }
From source file:captureplugin.CapturePlugin.java
public ActionMenu getContextMenuActions(final Program program) { final DeviceIf[] devices = mConfig.getDeviceArray(); final Window parent = UiUtilities.getLastModalChildOf(getParentFrame()); Action mainaction = new devplugin.ContextMenuAction(); mainaction.putValue(Action.NAME, mLocalizer.msg("record", "record Program")); mainaction.putValue(Action.SMALL_ICON, createImageIcon("mimetypes", "video-x-generic", 16)); ArrayList<ActionMenu> actionList = new ArrayList<ActionMenu>(); for (final DeviceIf dev : devices) { Action action = new ContextMenuAction(); action.putValue(Action.NAME, dev.getName()); ArrayList<AbstractAction> commandList = new ArrayList<AbstractAction>(); if (dev.isAbleToAddAndRemovePrograms()) { final Program test = dev.getProgramForProgramInList(program); if (test != null) { AbstractAction caction = new AbstractAction() { public void actionPerformed(ActionEvent evt) { dev.remove(parent, test); updateMarkedPrograms(); }//from w w w . j a v a 2 s . c om }; caction.putValue(Action.NAME, Localizer.getLocalization(Localizer.I18N_DELETE)); commandList.add(caction); } else { AbstractAction caction = new AbstractAction() { public void actionPerformed(ActionEvent evt) { if (dev.add(parent, program)) { dev.sendProgramsToReceiveTargets(new Program[] { program }); } updateMarkedPrograms(); } }; caction.putValue(Action.NAME, mLocalizer.msg("record", "record")); commandList.add(caction); } } String[] commands = dev.getAdditionalCommands(); if (commands != null) { for (int y = 0; y < commands.length; y++) { final int num = y; AbstractAction caction = new AbstractAction() { public void actionPerformed(ActionEvent evt) { dev.executeAdditionalCommand(parent, num, program); } }; caction.putValue(Action.NAME, commands[y]); commandList.add(caction); } } if (!commandList.isEmpty()) { actionList.add(new ActionMenu(action, commandList.toArray(new Action[commandList.size()]))); } } if (actionList.size() == 1) { ActionMenu menu = actionList.get(0); if (menu.getSubItems().length == 0) { return null; } if (menu.getSubItems().length == 1) { Action action = menu.getSubItems()[0].getAction(); action.putValue(Action.SMALL_ICON, createImageIcon("mimetypes", "video-x-generic", 16)); return new ActionMenu(action); } else { mainaction.putValue(Action.NAME, menu.getTitle()); return new ActionMenu(mainaction, menu.getSubItems()); } } ActionMenu[] actions = new ActionMenu[actionList.size()]; actionList.toArray(actions); if (actions.length == 0) { return null; } return new ActionMenu(mainaction, actions); }
From source file:pl.otros.logview.gui.LogViewMainFrame.java
private void initExperimental() { JMenu menu = new JMenu("Experimental"); menu.add(new JLabel("Experimental features, can have bugs", Icons.LEVEL_WARNING, SwingConstants.LEADING)); menu.add(new JSeparator()); boolean storeOnDisk = StringUtils.equalsIgnoreCase(System.getProperty("cacheEvents"), "true"); JRadioButtonMenuItem radioButtonMemory = new JRadioButtonMenuItem("Memory - faster, more memory required", !storeOnDisk);//from ww w .ja v a 2 s. com radioButtonMemory.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.setProperty("cacheEvents", Boolean.FALSE.toString()); } }); JRadioButtonMenuItem radioButtonDisk = new JRadioButtonMenuItem( "Disk with caching - slower, less memory required", storeOnDisk); radioButtonDisk.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { System.setProperty("cacheEvents", Boolean.TRUE.toString()); } }); final ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(radioButtonDisk); buttonGroup.add(radioButtonMemory); menu.add(new JSeparator(JSeparator.VERTICAL)); menu.add(new JLabel("Keep parsed log events store:")); menu.add(radioButtonMemory); menu.add(radioButtonDisk); final JCheckBox soapFormatterRemoveMultirefsCbx = new JCheckBox(); soapFormatterRemoveMultirefsCbx .setSelected(configuration.getBoolean(ConfKeys.FORMATTER_SOAP_REMOVE_MULTIREFS, false)); AbstractAction enableMultiRefRemoveFeature = new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { SoapMessageFormatter soapMessageFormatter = (SoapMessageFormatter) AllPluginables.getInstance() .getMessageFormatters().getElement(SoapMessageFormatter.class.getName()); soapMessageFormatter.setRemoveMultiRefs(soapFormatterRemoveMultirefsCbx.isSelected()); configuration.setProperty(ConfKeys.FORMATTER_SOAP_REMOVE_MULTIREFS, soapFormatterRemoveMultirefsCbx.isSelected()); } }; enableMultiRefRemoveFeature.putValue(Action.NAME, "Remove mulitRefs from SOAP messages"); soapFormatterRemoveMultirefsCbx.setAction(enableMultiRefRemoveFeature); enableMultiRefRemoveFeature.actionPerformed(null); final JCheckBox soapFormatterRemoveXsiForNilElementsCbx = new JCheckBox(); soapFormatterRemoveXsiForNilElementsCbx .setSelected(configuration.getBoolean(FORMATTER_SOAP_REMOVE_XSI_FOR_NIL, false)); AbstractAction soapFormatterRemoveXsiFromNilAction = new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { SoapMessageFormatter soapMessageFormatter = (SoapMessageFormatter) AllPluginables.getInstance() .getMessageFormatters().getElement(SoapMessageFormatter.class.getName()); soapMessageFormatter .setRemoveXsiForNilElements(soapFormatterRemoveXsiForNilElementsCbx.isSelected()); configuration.setProperty(FORMATTER_SOAP_REMOVE_XSI_FOR_NIL, soapFormatterRemoveXsiForNilElementsCbx.isSelected()); } }; soapFormatterRemoveXsiFromNilAction.putValue(Action.NAME, "Remove xsi for for NIL elements from SOAP messages"); soapFormatterRemoveXsiForNilElementsCbx.setAction(soapFormatterRemoveXsiFromNilAction); soapFormatterRemoveXsiFromNilAction.actionPerformed(null); menu.add(soapFormatterRemoveMultirefsCbx); menu.add(soapFormatterRemoveXsiForNilElementsCbx); getJMenuBar().add(menu); QueryFilter queryFilter = new QueryFilter(); allPluginables.getLogFiltersContainer().addElement(queryFilter); JButton b = new JButton("Throw exception"); b.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (System.currentTimeMillis() % 2 == 0) { throw new RuntimeException("Exception swing action!"); } else { new Thread(new Runnable() { @Override public void run() { throw new RuntimeException("Exception from tread!"); } }).start(); } } }); menu.add(b); }
From source file:Installer.java
public Installer(File targetDir) { ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); JPanel logoSplash = new JPanel(); logoSplash.setLayout(new BoxLayout(logoSplash, BoxLayout.Y_AXIS)); try {/*from w w w. j a v a 2 s .co m*/ // Read png BufferedImage image; image = ImageIO.read(Installer.class.getResourceAsStream("logo.png")); ImageIcon icon = new ImageIcon(image); JLabel logoLabel = new JLabel(icon); logoLabel.setAlignmentX(CENTER_ALIGNMENT); logoLabel.setAlignmentY(CENTER_ALIGNMENT); logoLabel.setSize(image.getWidth(), image.getHeight()); if (!QUIET_DEV) // VIVE - hide oculus logo logoSplash.add(logoLabel); } catch (IOException e) { } catch (IllegalArgumentException e) { } userHomeDir = System.getProperty("user.home", "."); osType = System.getProperty("os.name").toLowerCase(); if (osType.contains("win")) { isWindows = true; appDataDir = System.getenv("APPDATA"); } version = "UNKNOWN"; try { InputStream ver = Installer.class.getResourceAsStream("version"); if (ver != null) { String[] tok = new BufferedReader(new InputStreamReader(ver)).readLine().split(":"); if (tok.length > 0) { jar_id = tok[0]; version = tok[1]; } } } catch (IOException e) { } // Read release notes, save to file String tmpFileName = System.getProperty("java.io.tmpdir") + releaseNotePathAddition + "Vivecraft" + version.toLowerCase() + "_release_notes.txt"; releaseNotes = new File(tmpFileName); InputStream is = Installer.class.getResourceAsStream("release_notes.txt"); if (!copyInputStreamToFile(is, releaseNotes)) { releaseNotes = null; } JLabel tag = new JLabel("Welcome! This will install Vivecraft " + version); tag.setAlignmentX(CENTER_ALIGNMENT); tag.setAlignmentY(CENTER_ALIGNMENT); logoSplash.add(tag); logoSplash.add(Box.createRigidArea(new Dimension(5, 20))); tag = new JLabel("Select path to minecraft. (The default here is almost always what you want.)"); tag.setAlignmentX(CENTER_ALIGNMENT); tag.setAlignmentY(CENTER_ALIGNMENT); logoSplash.add(tag); logoSplash.setAlignmentX(CENTER_ALIGNMENT); logoSplash.setAlignmentY(TOP_ALIGNMENT); this.add(logoSplash); JPanel entryPanel = new JPanel(); entryPanel.setLayout(new BoxLayout(entryPanel, BoxLayout.X_AXIS)); Installer.targetDir = targetDir; selectedDirText = new JTextField(); selectedDirText.setEditable(false); selectedDirText.setToolTipText("Path to minecraft"); selectedDirText.setColumns(30); entryPanel.add(selectedDirText); JButton dirSelect = new JButton(); dirSelect.setAction(new FileSelectAction()); dirSelect.setText("..."); dirSelect.setToolTipText("Select an alternative minecraft directory"); entryPanel.add(dirSelect); entryPanel.setAlignmentX(LEFT_ALIGNMENT); entryPanel.setAlignmentY(TOP_ALIGNMENT); infoLabel = new JLabel(); infoLabel.setHorizontalTextPosition(JLabel.LEFT); infoLabel.setVerticalTextPosition(JLabel.TOP); infoLabel.setAlignmentX(LEFT_ALIGNMENT); infoLabel.setAlignmentY(TOP_ALIGNMENT); infoLabel.setVisible(false); fileEntryPanel = new JPanel(); fileEntryPanel.setLayout(new BoxLayout(fileEntryPanel, BoxLayout.Y_AXIS)); fileEntryPanel.add(infoLabel); fileEntryPanel.add(entryPanel); fileEntryPanel.setAlignmentX(CENTER_ALIGNMENT); fileEntryPanel.setAlignmentY(TOP_ALIGNMENT); this.add(fileEntryPanel); this.add(Box.createVerticalStrut(5)); JPanel optPanel = new JPanel(); optPanel.setLayout(new BoxLayout(optPanel, BoxLayout.Y_AXIS)); optPanel.setAlignmentX(LEFT_ALIGNMENT); optPanel.setAlignmentY(TOP_ALIGNMENT); //Add forge options JPanel forgePanel = new JPanel(); forgePanel.setLayout(new BoxLayout(forgePanel, BoxLayout.X_AXIS)); //Create forge: no/yes buttons useForge = new JCheckBox(); AbstractAction actf = new updateActionF(); actf.putValue(AbstractAction.NAME, "Install Vivecraft with Forge " + FORGE_VERSION); useForge.setAction(actf); forgeVersion = new JComboBox(); if (!ALLOW_FORGE_INSTALL) useForge.setEnabled(false); useForge.setToolTipText( "<html>" + "If checked, installs Vivecraft with Forge support. The correct version of Forge<br>" + "(as displayed) must already be installed.<br>" + "</html>"); //Add "yes" and "which version" to the forgePanel useForge.setAlignmentX(LEFT_ALIGNMENT); forgeVersion.setAlignmentX(LEFT_ALIGNMENT); forgePanel.add(useForge); //forgePanel.add(forgeVersion); // Profile creation / update support createProfile = new JCheckBox("", true); AbstractAction actp = new updateActionP(); actp.putValue(AbstractAction.NAME, "Create Vivecraft launcher profile"); createProfile.setAction(actp); createProfile.setAlignmentX(LEFT_ALIGNMENT); createProfile.setSelected(true); createProfile.setToolTipText("<html>" + "If checked, if a Vivecraft profile doesn't already exist within the Minecraft launcher<br>" + "one is added. Then the profile is selected, and this Vivecraft version is set as the<br>" + "current version.<br>" + "</html>"); useShadersMod = new JCheckBox(); useShadersMod.setAlignmentX(LEFT_ALIGNMENT); if (!ALLOW_SHADERSMOD_INSTALL) useShadersMod.setEnabled(false); AbstractAction acts = new updateActionSM(); acts.putValue(AbstractAction.NAME, "Install Vivecraft with ShadersMod 2.3.29"); useShadersMod.setAction(acts); useShadersMod.setToolTipText("<html>" + "If checked, sets the vivecraft profile to use ShadersMod <br>" + "support." + "</html>"); useHydra = new JCheckBox("Razer Hydra support", false); useHydra.setAlignmentX(LEFT_ALIGNMENT); if (!ALLOW_HYDRA_INSTALL) useHydra.setEnabled(false); useHydra.setToolTipText("<html>" + "If checked, installs the additional Razor Hydra native library required for Razor Hydra<br>" + "support." + "</html>"); useHrtf = new JCheckBox("Enable binaural audio (Only needed once per PC)", false); useHrtf.setToolTipText("<html>" + "If checked, the installer will create the configuration file needed for OpenAL HRTF<br>" + "ear-aware sound in Minecraft (and other games).<br>" + " If the file has previously been created, you do not need to check this again.<br>" + " NOTE: Your sound card's output MUST be set to 44.1Khz.<br>" + " WARNING, will overwrite " + (isWindows ? (appDataDir + "\\alsoft.ini") : (userHomeDir + "/.alsoftrc")) + "!<br>" + " Delete the " + (isWindows ? "alsoft.ini" : "alsoftrc") + " file to disable HRTF again." + "</html>"); useHrtf.setAlignmentX(LEFT_ALIGNMENT); //Add option panels option panel forgePanel.setAlignmentX(LEFT_ALIGNMENT); //optPanel.add(forgePanel); //optPanel.add(useShadersMod); optPanel.add(createProfile); optPanel.add(useHrtf); this.add(optPanel); this.add(Box.createRigidArea(new Dimension(5, 20))); instructions = new JLabel("", SwingConstants.CENTER); instructions.setAlignmentX(CENTER_ALIGNMENT); instructions.setAlignmentY(TOP_ALIGNMENT); instructions.setForeground(Color.RED); instructions.setPreferredSize(new Dimension(20, 40)); this.add(instructions); this.add(Box.createVerticalGlue()); JLabel github = linkify("Vivecraft is open source. find it on Github", "https://github.com/jrbudda/Vivecraft_111", "Vivecraft 1.11 Github"); JLabel wiki = linkify("Vivecraft home page", "http://www.vivecraft.org", "Vivecraft Home"); JLabel donate = linkify("If you think Vivecraft is awesome, please consider donating.", "https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)", "jrbudda's Paypal"); JLabel optifine = linkify("Vivecraft includes OptiFine for performance. Consider donating to them as well.", "http://optifine.net/donate.php", "http://optifine.net/donate.php"); github.setAlignmentX(CENTER_ALIGNMENT); github.setHorizontalAlignment(SwingConstants.CENTER); wiki.setAlignmentX(CENTER_ALIGNMENT); wiki.setHorizontalAlignment(SwingConstants.CENTER); donate.setAlignmentX(CENTER_ALIGNMENT); donate.setHorizontalAlignment(SwingConstants.CENTER); optifine.setAlignmentX(CENTER_ALIGNMENT); optifine.setHorizontalAlignment(SwingConstants.CENTER); this.add(Box.createRigidArea(new Dimension(5, 20))); this.add(github); this.add(wiki); this.add(donate); this.add(optifine); this.setAlignmentX(LEFT_ALIGNMENT); updateFilePath(); updateInstructions(); }