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;
}
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()));
}
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");
}
}
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);
}
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();
}
;
};
}
Aggregations