List of usage examples for javax.swing.border BevelBorder RAISED
int RAISED
To view the source code for javax.swing.border BevelBorder RAISED.
Click Source Link
From source file:Main.java
public Main() { menuBar = new JMenuBar(); JMenu justifyMenu = new JMenu("Justify"); ActionListener actionPrinter = new ActionListener() { public void actionPerformed(ActionEvent e) { try { pane.getStyledDocument().insertString(0, "Action [" + e.getActionCommand() + "] performed!\n", null);/* ww w . j a va 2 s . c o m*/ } catch (Exception ex) { ex.printStackTrace(); } } }; JRadioButtonMenuItem leftJustify = new JRadioButtonMenuItem("Left", new ImageIcon("1.gif")); leftJustify.setHorizontalTextPosition(JMenuItem.RIGHT); leftJustify .setAccelerator(KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); leftJustify.addActionListener(actionPrinter); JRadioButtonMenuItem rightJustify = new JRadioButtonMenuItem("Right", new ImageIcon("2.gif")); rightJustify.setHorizontalTextPosition(JMenuItem.RIGHT); rightJustify .setAccelerator(KeyStroke.getKeyStroke('R', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); rightJustify.addActionListener(actionPrinter); JRadioButtonMenuItem centerJustify = new JRadioButtonMenuItem("Center", new ImageIcon("3.gif")); centerJustify.setHorizontalTextPosition(JMenuItem.RIGHT); centerJustify .setAccelerator(KeyStroke.getKeyStroke('M', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); centerJustify.addActionListener(actionPrinter); JRadioButtonMenuItem fullJustify = new JRadioButtonMenuItem("Full", new ImageIcon("4.gif")); fullJustify.setHorizontalTextPosition(JMenuItem.RIGHT); fullJustify .setAccelerator(KeyStroke.getKeyStroke('F', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fullJustify.addActionListener(actionPrinter); ButtonGroup group = new ButtonGroup(); group.add(leftJustify); group.add(rightJustify); group.add(centerJustify); group.add(fullJustify); justifyMenu.add(leftJustify); justifyMenu.add(rightJustify); justifyMenu.add(centerJustify); justifyMenu.add(fullJustify); menuBar.add(justifyMenu); menuBar.setBorder(new BevelBorder(BevelBorder.RAISED)); }
From source file:CheckBoxMenuItemExample.java
public CheckBoxMenuItemExample() { menuBar = new JMenuBar(); JMenu justifyMenu = new JMenu("Justify"); ActionListener actionPrinter = new ActionListener() { public void actionPerformed(ActionEvent e) { try { pane.getStyledDocument().insertString(0, "Action [" + e.getActionCommand() + "] performed!\n", null);/*from w w w . ja v a2s.c o m*/ } catch (Exception ex) { ex.printStackTrace(); } } }; JCheckBoxMenuItem leftJustify = new JCheckBoxMenuItem("Left", new ImageIcon("1.gif")); leftJustify.setHorizontalTextPosition(JMenuItem.RIGHT); leftJustify .setAccelerator(KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); leftJustify.addActionListener(actionPrinter); JCheckBoxMenuItem rightJustify = new JCheckBoxMenuItem("Right", new ImageIcon("2.gif")); rightJustify.setHorizontalTextPosition(JMenuItem.RIGHT); rightJustify .setAccelerator(KeyStroke.getKeyStroke('R', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); rightJustify.addActionListener(actionPrinter); JCheckBoxMenuItem centerJustify = new JCheckBoxMenuItem("Center", new ImageIcon("3.gif")); centerJustify.setHorizontalTextPosition(JMenuItem.RIGHT); centerJustify .setAccelerator(KeyStroke.getKeyStroke('M', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); centerJustify.addActionListener(actionPrinter); JCheckBoxMenuItem fullJustify = new JCheckBoxMenuItem("Full", new ImageIcon("4.gif")); fullJustify.setHorizontalTextPosition(JMenuItem.RIGHT); fullJustify .setAccelerator(KeyStroke.getKeyStroke('F', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fullJustify.addActionListener(actionPrinter); justifyMenu.add(leftJustify); justifyMenu.add(rightJustify); justifyMenu.add(centerJustify); justifyMenu.add(fullJustify); menuBar.add(justifyMenu); menuBar.setBorder(new BevelBorder(BevelBorder.RAISED)); }
From source file:RadioButtonMenuItemExample.java
public RadioButtonMenuItemExample() { menuBar = new JMenuBar(); JMenu justifyMenu = new JMenu("Justify"); ActionListener actionPrinter = new ActionListener() { public void actionPerformed(ActionEvent e) { try { pane.getStyledDocument().insertString(0, "Action [" + e.getActionCommand() + "] performed!\n", null);/*from ww w. j a v a2 s . c o m*/ } catch (Exception ex) { ex.printStackTrace(); } } }; JRadioButtonMenuItem leftJustify = new JRadioButtonMenuItem("Left", new ImageIcon("1.gif")); leftJustify.setHorizontalTextPosition(JMenuItem.RIGHT); leftJustify .setAccelerator(KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); leftJustify.addActionListener(actionPrinter); JRadioButtonMenuItem rightJustify = new JRadioButtonMenuItem("Right", new ImageIcon("2.gif")); rightJustify.setHorizontalTextPosition(JMenuItem.RIGHT); rightJustify .setAccelerator(KeyStroke.getKeyStroke('R', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); rightJustify.addActionListener(actionPrinter); JRadioButtonMenuItem centerJustify = new JRadioButtonMenuItem("Center", new ImageIcon("3.gif")); centerJustify.setHorizontalTextPosition(JMenuItem.RIGHT); centerJustify .setAccelerator(KeyStroke.getKeyStroke('M', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); centerJustify.addActionListener(actionPrinter); JRadioButtonMenuItem fullJustify = new JRadioButtonMenuItem("Full", new ImageIcon("4.gif")); fullJustify.setHorizontalTextPosition(JMenuItem.RIGHT); fullJustify .setAccelerator(KeyStroke.getKeyStroke('F', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); fullJustify.addActionListener(actionPrinter); ButtonGroup group = new ButtonGroup(); group.add(leftJustify); group.add(rightJustify); group.add(centerJustify); group.add(fullJustify); justifyMenu.add(leftJustify); justifyMenu.add(rightJustify); justifyMenu.add(centerJustify); justifyMenu.add(fullJustify); menuBar.add(justifyMenu); menuBar.setBorder(new BevelBorder(BevelBorder.RAISED)); }
From source file:mergedoc.ui.MergeDocFrame.java
/** * ??????/*ww w . j a v a 2 s .c o m*/ * @throws MergeDocException ????? */ private void initComponent() throws MergeDocException { // ???? preferencePanel = new PreferencePanel(); mergeManager = new MergeManager(); // ??? mainPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.X_AXIS)); mainPanel.add(preferencePanel); // ?????? JPanel outerPanel = new JPanel(); outerPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); outerPanel.setLayout(new BoxLayout(outerPanel, BoxLayout.Y_AXIS)); outerPanel.add(mainPanel); outerPanel.add(ComponentFactory.createSpacer(0, 7)); outerPanel.add(buttonBar); getContentPane().add(outerPanel); // ? initListener(); buttonBar.setState(buttonBar.INIT_STATE); // ConfigManager config = ConfigManager.getInstance(); String iconPath = config.getFile("icon.png").toString(); Image icon = Toolkit.getDefaultToolkit().createImage(iconPath); setIconImage(icon); // setTitle(SETTING_TITLE); Persister psst = Persister.getInstance(); setLocation(psst.getInt(Persister.WINDOW_X, 0), psst.getInt(Persister.WINDOW_Y, 0)); setSize(psst.getInt(Persister.WINDOW_WIDTH, 700), psst.getInt(Persister.WINDOW_HEIGHT, 570)); int state = psst.getInt(Persister.WINDOW_STATE, NORMAL); if ((state & Frame.ICONIFIED) != ICONIFIED) { setExtendedState(state); } setVisible(true); }
From source file:org.eurocarbdb.application.glycoworkbench.plugin.PeakAnnotationCalibrationPanel.java
protected void initComponents() { setLayout(new BorderLayout()); // create structure viewer theStructure = new JLabel(); theStructure.setBorder(new BevelBorder(BevelBorder.RAISED)); add(theStructure, BorderLayout.NORTH); // create chart theDataset = new DefaultXYDataset(); theChart = org.jfree.chart.ChartFactory.createScatterPlot("Calibration", "m/z ratio", "accuracy (Da)", theDataset, org.jfree.chart.plot.PlotOrientation.VERTICAL, true, false, false); thePlot = (XYPlot) theChart.getPlot(); theChartPanel = new ChartPanel(theChart); theChartPanel.setDomainZoomable(true); theChartPanel.setRangeZoomable(true); theChartPanel.setPopupMenu(null);/* ww w .ja v a 2 s.c o m*/ add(theChartPanel, BorderLayout.CENTER); // create toolbar JPanel theToolBarPanel = new JPanel(new BorderLayout()); theToolBarDocument = createToolBarDocument(); theToolBarEdit = createToolBarEdit(); theToolBarPanel.add(theToolBarDocument, BorderLayout.NORTH); theToolBarPanel.add(theToolBarEdit, BorderLayout.CENTER); add(theToolBarPanel, BorderLayout.SOUTH); // load cursors hand_cursor = FileUtils.createCursor("hand"); }
From source file:org.adempiere.apps.graph.PerformanceIndicator.java
/** * Constructor/*from ww w .ja v a 2 s .c o m*/ * @param goal goal model */ public PerformanceIndicator(MGoal goal) { super(); m_goal = goal; setName(m_goal.getName()); //vpj-cd e-evolution getPreferredSize(); // calculate size init(); // setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); setOpaque(true); //vpj-cd e-evolution updateDisplay(); // mRefresh.addActionListener(this); popupMenu.add(mRefresh); // addMouseListener(this); }
From source file:DesktopManagerDemo.java
public DesktopManagerDemo() { setTitle("Animated DesktopManager"); m_count = m_tencount = 0;/*from www. ja v a 2s. c o m*/ JPanel innerListenerPanel = new JPanel(new GridLayout(15, 1)); JPanel listenerPanel = new JPanel(new BorderLayout()); m_dmEventCanvas = new DMEventCanvas(); m_lActivates = new JLabel("activateFrame"); m_lBegindrags = new JLabel("beginDraggingFrame"); m_lBeginresizes = new JLabel("beginResizingFrame"); m_lCloses = new JLabel("closeFrame"); m_lDeactivates = new JLabel("deactivateFrame"); m_lDeiconifies = new JLabel("deiconifyFrame"); m_lDrags = new JLabel("dragFrame"); m_lEnddrags = new JLabel("endDraggingFrame"); m_lEndresizes = new JLabel("endResizingFrame"); m_lIconifies = new JLabel("iconifyFrame"); m_lMaximizes = new JLabel("maximizeFrame"); m_lMinimizes = new JLabel("minimizeFrame"); m_lOpens = new JLabel("openFrame"); m_lResizes = new JLabel("resizeFrame"); m_lSetbounds = new JLabel("setBoundsForFrame"); innerListenerPanel.add(m_lActivates); innerListenerPanel.add(m_lBegindrags); innerListenerPanel.add(m_lBeginresizes); innerListenerPanel.add(m_lCloses); innerListenerPanel.add(m_lDeactivates); innerListenerPanel.add(m_lDeiconifies); innerListenerPanel.add(m_lDrags); innerListenerPanel.add(m_lEnddrags); innerListenerPanel.add(m_lEndresizes); innerListenerPanel.add(m_lIconifies); innerListenerPanel.add(m_lMaximizes); innerListenerPanel.add(m_lMinimizes); innerListenerPanel.add(m_lOpens); innerListenerPanel.add(m_lResizes); innerListenerPanel.add(m_lSetbounds); listenerPanel.add("Center", m_dmEventCanvas); listenerPanel.add("West", innerListenerPanel); listenerPanel.setOpaque(true); listenerPanel.setBackground(Color.white); m_myDesktopManager = new MyDesktopManager(); m_desktop = new JDesktopPane(); m_desktop.setDesktopManager(m_myDesktopManager); m_desktop.setBorder(new SoftBevelBorder(BevelBorder.LOWERED)); m_newFrame = new JButton("New Frame"); m_newFrame.addActionListener(this); m_infos = UIManager.getInstalledLookAndFeels(); String[] LAFNames = new String[m_infos.length]; for (int i = 0; i < m_infos.length; i++) { LAFNames[i] = m_infos[i].getName(); } m_UIBox = new JComboBox(LAFNames); m_UIBox.addActionListener(this); JPanel topPanel = new JPanel(true); topPanel.setLayout(new FlowLayout()); topPanel.setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new CompoundBorder(new EmptyBorder(2, 2, 2, 2), new SoftBevelBorder(BevelBorder.RAISED)))); getContentPane().setLayout(new BorderLayout()); getContentPane().add("North", topPanel); getContentPane().add("Center", m_desktop); getContentPane().add("South", listenerPanel); ((JPanel) getContentPane()).setBorder(new CompoundBorder(new SoftBevelBorder(BevelBorder.LOWERED), new CompoundBorder(new EmptyBorder(1, 1, 1, 1), new SoftBevelBorder(BevelBorder.RAISED)))); topPanel.add(m_newFrame); topPanel.add(new JLabel("Look & Feel:", SwingConstants.RIGHT)); topPanel.add(m_UIBox); setSize(645, 600); Dimension dim = getToolkit().getScreenSize(); setLocation(dim.width / 2 - getWidth() / 2, dim.height / 2 - getHeight() / 2); setVisible(true); WindowListener l = new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }; addWindowListener(l); m_eventTimer = new Timer(1000, this); m_eventTimer.setRepeats(true); m_eventTimer.start(); }
From source file:hermes.browser.dialog.HermesAdminFactoryConfigPanel.java
public void init() { final Border border = BorderFactory.createBevelBorder(BevelBorder.RAISED); setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder(border, ADMIN_FACTORY)); afCombo.setModel(cfComboModel);// w ww .j av a2 s.co m propertyTableSP.setViewportView(propertyTable); propertyTable.setSortable(true); add(afCombo, BorderLayout.NORTH); add(propertyTableSP, BorderLayout.CENTER); popupMenu.add(addItem); popupMenu.add(removeItem); addItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { try { propertyTableModel.insertRow(); } catch (Exception ex) { cat.error(ex.getMessage(), ex); } } }); removeItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if (propertyTable.getSelectedRow() != -1) { propertyTableModel.removeRow(propertyTable.getSelectedRow()); } } }); final MouseAdapter m = new MouseAdapter() { public void mousePressed(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { if (e.getComponent() == propertyTableSP) { removeItem.setEnabled(false); } else { removeItem.setEnabled(true); } if (propertySelectionComboBox.getModel().getSize() == 0) { addItem.setEnabled(false); } else { addItem.setEnabled(true); } popupMenu.show(e.getComponent(), e.getX(), e.getY()); } } }; propertyTableSP.addMouseListener(m); propertyTable.addMouseListener(m); propertyTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); cfComboModel.addListDataListener(new ListDataListener() { public void contentsChanged(ListDataEvent arg0) { final String className = HermesBrowser.getConfigDAO() .getAdminClassForPlugIn((String) cfComboModel.getSelectedItem()); final ClassLoaderManager classLoaderManager = (ClassLoaderManager) SingletonManager .get(ClassLoaderManager.class); try { if (propertyTableModel != null) { final ClassLoader classLoader = classLoaderManager .getClassLoader(dialog.getSelectedLoader()); Thread.currentThread().setContextClassLoader(classLoader); bean = (HermesAdminFactory) classLoader.loadClass(className).newInstance(); propertyTableModel.setBean(bean); updateCellEditor(); dialog.setDirty(); } } catch (Throwable e) { HermesBrowser.getBrowser().showErrorDialog( "Unable to locate this plugin.\nSelect the loader the JMS provider classes are in before choosing the plugin."); cfComboModel.setSelectedItem(ConfigDAO.DEFAULT_PLUGIN); } } public void intervalAdded(ListDataEvent arg0) { // NOP } public void intervalRemoved(ListDataEvent arg0) { // NOP } }); }
From source file:hermes.browser.dialog.GeneralRendererConfigPanel.java
private void init() { Border border = BorderFactory.createBevelBorder(BevelBorder.RAISED); JPanel topPanel = new JPanel(); topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); topPanel.setLayout(new GridLayout(1, 2)); infoLabel1.setText("Message Renderers"); setLayout(new BorderLayout()); setBorder(BorderFactory.createTitledBorder(border, "Renderers")); topPanel.add(infoLabel1);/* w w w . ja va 2 s .com*/ topSP.setViewportView(classTable); classTable.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); add(topPanel, BorderLayout.NORTH); add(splitPane, BorderLayout.CENTER); splitPane.add(topSP, "top"); splitPane.add(bottomSP, "bottom"); splitPane.setDividerLocation(200); // splitPane.setShowGripper(true) ; classTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { doRendererSelected(e); } }); }
From source file:hermes.browser.dialog.DestinationPropertyConfigPanel.java
public DestinationPropertyConfigPanel(String hermesId, Destination bean, DestinationConfig config) { try {//from ww w . j a va 2s .c o m this.bean = bean; this.config = config; final Border border = BorderFactory.createBevelBorder(BevelBorder.RAISED); setLayout(new BorderLayout()); add(tabbedPane); generalPanel.setLayout(new BorderLayout()); if (bean != null) { beanPropertyPanel = new BeanPropertyPanel(bean, true, false); beanPropertyPanel.init(); beanPropertyPanel.setBorder(BorderFactory.createTitledBorder(border, "Provider Properties")); } generalPanel.setBorder(BorderFactory.createTitledBorder(border, "Hermes Properties")); tabbedPane.add("Hermes", generalPanel); if (bean != null) { tabbedPane.add("Provider", beanPropertyPanel); } tabbedPane.setTabPlacement(JTabbedPane.BOTTOM); init(); } catch (IllegalAccessException e) { throw new HermesRuntimeException(e); } catch (InvocationTargetException e) { throw new HermesRuntimeException(e); } catch (NoSuchMethodException e) { throw new HermesRuntimeException(e); } }