Search in sources :

Example 1 with JEditorPane

use of javax.swing.JEditorPane in project pcgen by PCGen.

the class InfoGuidePane method createHtmlPane.

private static JEditorPane createHtmlPane() {
    JEditorPane htmlPane = new JEditorPane();
    htmlPane.setOpaque(false);
    htmlPane.setContentType("text/html");
    htmlPane.setEditable(false);
    htmlPane.setFocusable(true);
    return htmlPane;
}
Also used : JEditorPane(javax.swing.JEditorPane)

Example 2 with JEditorPane

use of javax.swing.JEditorPane in project pcgen by PCGen.

the class InfoGuidePane method initComponents.

private void initComponents() {
    mainPanel = new JPanel();
    mainPanel.setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.CENTER, TitledBorder.DEFAULT_POSITION, null));
    mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
    mainPanel.setPreferredSize(new Dimension(650, 450));
    setOpaque(false);
    JPanel sourcesPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc1 = new GridBagConstraints();
    gbc1.anchor = GridBagConstraints.EAST;
    GridBagConstraints gbc2 = new GridBagConstraints();
    gbc2.gridwidth = GridBagConstraints.REMAINDER;
    gbc2.fill = GridBagConstraints.BOTH;
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_intro")), gbc2);
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_gamemode")), gbc1);
    sourcesPanel.add(gameModeLabel, gbc2);
    sourcesPanel.add(new JLabel(LanguageBundle.getString("in_si_sources")), gbc1);
    sourcesPanel.add(campaignList, gbc2);
    JEditorPane guidePane = createHtmlPane();
    guidePane.setText(LanguageBundle.getFormattedString("in_si_whatnext", Icons.New16.getImageIcon(), Icons.Open16.getImageIcon()));
    mainPanel.add(sourcesPanel);
    mainPanel.add(guidePane);
    mainPanel.add(tipPane);
    refreshDisplayedSources(null);
    JPanel outerPanel = new JPanel(new FlowLayout());
    outerPanel.add(mainPanel);
    setLayout(new BorderLayout());
    add(outerPanel, BorderLayout.CENTER);
    tipPane.setText(LanguageBundle.getFormattedString("in_si_tip", TipOfTheDayHandler.getInstance().getNextTip()));
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) GridBagLayout(java.awt.GridBagLayout) BorderLayout(java.awt.BorderLayout) BoxLayout(javax.swing.BoxLayout) JEditorPane(javax.swing.JEditorPane) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension)

Example 3 with JEditorPane

use of javax.swing.JEditorPane in project jdk8u_jdk by JetBrains.

the class DimensionEncapsulation method run.

@Override
public void run() {
    runTest(new Panel());
    runTest(new Button());
    runTest(new Checkbox());
    runTest(new Canvas());
    runTest(new Choice());
    runTest(new Label());
    runTest(new Scrollbar());
    runTest(new TextArea());
    runTest(new TextField());
    runTest(new Dialog(new JFrame()));
    runTest(new Frame());
    runTest(new Window(new JFrame()));
    runTest(new FileDialog(new JFrame()));
    runTest(new List());
    runTest(new ScrollPane());
    runTest(new JFrame());
    runTest(new JDialog(new JFrame()));
    runTest(new JWindow(new JFrame()));
    runTest(new JLabel("hi"));
    runTest(new JMenu());
    runTest(new JTree());
    runTest(new JTable());
    runTest(new JMenuItem());
    runTest(new JCheckBoxMenuItem());
    runTest(new JToggleButton());
    runTest(new JSpinner());
    runTest(new JSlider());
    runTest(Box.createVerticalBox());
    runTest(Box.createHorizontalBox());
    runTest(new JTextField());
    runTest(new JTextArea());
    runTest(new JTextPane());
    runTest(new JPasswordField());
    runTest(new JFormattedTextField());
    runTest(new JEditorPane());
    runTest(new JButton());
    runTest(new JColorChooser());
    runTest(new JFileChooser());
    runTest(new JCheckBox());
    runTest(new JInternalFrame());
    runTest(new JDesktopPane());
    runTest(new JTableHeader());
    runTest(new JLayeredPane());
    runTest(new JRootPane());
    runTest(new JMenuBar());
    runTest(new JOptionPane());
    runTest(new JRadioButton());
    runTest(new JRadioButtonMenuItem());
    runTest(new JPopupMenu());
    //runTest(new JScrollBar()); --> don't test defines max and min in
    // terms of preferred
    runTest(new JScrollPane());
    runTest(new JViewport());
    runTest(new JSplitPane());
    runTest(new JTabbedPane());
    runTest(new JToolBar());
    runTest(new JSeparator());
    runTest(new JProgressBar());
    if (!failures.isEmpty()) {
        System.out.println("These classes failed");
        for (final Component failure : failures) {
            System.out.println(failure.getClass());
        }
        throw new RuntimeException("Test failed");
    }
}
Also used : JDesktopPane(javax.swing.JDesktopPane) Choice(java.awt.Choice) JTextArea(javax.swing.JTextArea) TextArea(java.awt.TextArea) JTextArea(javax.swing.JTextArea) Label(java.awt.Label) JLabel(javax.swing.JLabel) JTableHeader(javax.swing.table.JTableHeader) JToggleButton(javax.swing.JToggleButton) JToggleButton(javax.swing.JToggleButton) Button(java.awt.Button) JRadioButton(javax.swing.JRadioButton) JButton(javax.swing.JButton) JFrame(javax.swing.JFrame) Checkbox(java.awt.Checkbox) JDialog(javax.swing.JDialog) FileDialog(java.awt.FileDialog) Dialog(java.awt.Dialog) JTextField(javax.swing.JTextField) TextField(java.awt.TextField) JFormattedTextField(javax.swing.JFormattedTextField) JSlider(javax.swing.JSlider) ArrayList(java.util.ArrayList) List(java.awt.List) Canvas(java.awt.Canvas) JWindow(javax.swing.JWindow) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JOptionPane(javax.swing.JOptionPane) JCheckBoxMenuItem(javax.swing.JCheckBoxMenuItem) JCheckBox(javax.swing.JCheckBox) JTree(javax.swing.JTree) JFileChooser(javax.swing.JFileChooser) JPasswordField(javax.swing.JPasswordField) ScrollPane(java.awt.ScrollPane) JScrollPane(javax.swing.JScrollPane) JTable(javax.swing.JTable) JSpinner(javax.swing.JSpinner) JSplitPane(javax.swing.JSplitPane) JColorChooser(javax.swing.JColorChooser) JInternalFrame(javax.swing.JInternalFrame) JDialog(javax.swing.JDialog) JFrame(javax.swing.JFrame) Frame(java.awt.Frame) JInternalFrame(javax.swing.JInternalFrame) JRadioButton(javax.swing.JRadioButton) JLayeredPane(javax.swing.JLayeredPane) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) JTextPane(javax.swing.JTextPane) JMenuItem(javax.swing.JMenuItem) Component(java.awt.Component) Scrollbar(java.awt.Scrollbar) Window(java.awt.Window) JWindow(javax.swing.JWindow) JScrollPane(javax.swing.JScrollPane) JViewport(javax.swing.JViewport) JFormattedTextField(javax.swing.JFormattedTextField) JLabel(javax.swing.JLabel) JToolBar(javax.swing.JToolBar) JPopupMenu(javax.swing.JPopupMenu) Panel(java.awt.Panel) JEditorPane(javax.swing.JEditorPane) JRootPane(javax.swing.JRootPane) FileDialog(java.awt.FileDialog) JMenu(javax.swing.JMenu) JMenuBar(javax.swing.JMenuBar)

Example 4 with JEditorPane

use of javax.swing.JEditorPane in project adempiere by adempiere.

the class HelpInfo method createAndShowGui.

// METHODS
// =======
/**
	 * Create the GUI and show it
	 * @param component the calling component
	 */
public void createAndShowGui(Component component) {
    // title
    setTitle(s_logger.localizeMessage("guiHelpTitle"));
    // load icons
    ArrayList<Image> images = new ArrayList<Image>();
    images.add(getImage("AD16.png"));
    images.add(getImage("AD32.png"));
    setIconImages(images);
    // content pane
    Container pane = getContentPane();
    Locale locale = Locale.getDefault();
    pane.setComponentOrientation(ComponentOrientation.getOrientation(locale));
    pane.setLayout(new GridBagLayout());
    // help text
    JEditorPane info = new JEditorPane();
    info.setEditable(false);
    info.setContentType("text/html");
    HTMLDocument htmlDoc = (HTMLDocument) info.getEditorKit().createDefaultDocument();
    info.setDocument(htmlDoc);
    info.setText(getHelpText());
    info.setCaretPosition(0);
    // scrollable pane for help text
    JScrollPane infoPane = new JScrollPane();
    infoPane.setBorder(BorderFactory.createLoweredBevelBorder());
    infoPane.setPreferredSize(new Dimension(500, 400));
    infoPane.getViewport().add(info, null);
    pane.add(infoPane, getInfoPaneConstraints());
    // close button
    m_buttonClose = new JButton(s_logger.localizeMessage("guiButtonClose"));
    m_buttonClose.setMnemonic(new Integer(s_logger.localizeMessage("guiButtonCloseMnemonic")));
    m_buttonClose.setIcon(new ImageIcon(getImage("Cancel16.png")));
    m_buttonClose.addActionListener(this);
    pane.add(m_buttonClose, getCloseConstraints());
    // show dialog
    pack();
    validate();
    m_buttonClose.requestFocusInWindow();
    setLocationRelativeTo(component);
    setVisible(true);
}
Also used : Locale(java.util.Locale) JScrollPane(javax.swing.JScrollPane) ImageIcon(javax.swing.ImageIcon) GridBagLayout(java.awt.GridBagLayout) HTMLDocument(javax.swing.text.html.HTMLDocument) ArrayList(java.util.ArrayList) JButton(javax.swing.JButton) Dimension(java.awt.Dimension) Image(java.awt.Image) Container(java.awt.Container) JEditorPane(javax.swing.JEditorPane)

Example 5 with JEditorPane

use of javax.swing.JEditorPane in project adempiere by adempiere.

the class CAbstractBOMTree method preInit.

private void preInit() {
    northPanel = new CPanel();
    southPanel = new CPanel();
    contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    nodeDescription = new JEditorPane("text/html", "");
    nodeDescription.setOpaque(false);
    nodeDescription.setEditable(false);
    String columnName = null;
    int columnId = -1;
    if (BOMWrapper.BOM_TYPE_PRODUCT.equals(type())) {
        columnName = MProduct.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MProduct.Table_Name, columnName);
    } else if (BOMWrapper.BOM_TYPE_ORDER.equals(type())) {
        columnName = MPPOrder.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MPPOrder.Table_Name, columnName);
    }
    MLookup lm = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, columnId, DisplayType.Search);
    lookup = new VLookup(columnName, false, false, true, lm) {

        public void setValue(Object obj) {
            super.setValue(obj);
            dispatchPropertyChange();
        }

        ;
    };
}
Also used : MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) JEditorPane(javax.swing.JEditorPane) VLookup(org.compiere.grid.ed.VLookup) JSplitPane(javax.swing.JSplitPane)

Aggregations

JEditorPane (javax.swing.JEditorPane)129 JScrollPane (javax.swing.JScrollPane)53 Dimension (java.awt.Dimension)34 JPanel (javax.swing.JPanel)33 JButton (javax.swing.JButton)22 BorderLayout (java.awt.BorderLayout)20 JLabel (javax.swing.JLabel)20 IOException (java.io.IOException)16 JDialog (javax.swing.JDialog)15 JFrame (javax.swing.JFrame)15 HyperlinkEvent (javax.swing.event.HyperlinkEvent)15 HyperlinkListener (javax.swing.event.HyperlinkListener)14 GridBagConstraints (java.awt.GridBagConstraints)12 GridBagLayout (java.awt.GridBagLayout)12 URL (java.net.URL)12 ActionEvent (java.awt.event.ActionEvent)11 Component (java.awt.Component)10 FlowLayout (java.awt.FlowLayout)10 HTMLEditorKit (javax.swing.text.html.HTMLEditorKit)10 Font (java.awt.Font)9