Search in sources :

Example 1 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class NewFileFour method initComponents.

private void initComponents() {
    accountList = new JList<>();
    accountList.addMouseListener(new java.awt.event.MouseAdapter() {

        @Override
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            accountListMouseClicked(evt);
        }
    });
    accountTree = new JTree();
    accountTree.setModel(null);
    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewFileFour.txt"));
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JTree(javax.swing.JTree) JEditorPane(javax.swing.JEditorPane) MouseEvent(java.awt.event.MouseEvent)

Example 2 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class NewFileOne method initComponents.

private void initComponents() {
    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewFileOne.txt"));
    dbNameButton = new JButton("...");
    dbNameButton.addActionListener(this);
    overwriteLabel = new JLabel(rb.getString("Message.OverwriteDB"));
    overwriteLabel.setIcon(UIManager.getIcon("OptionPane.warningIcon"));
    overwriteLabel.setFont(overwriteLabel.getFont().deriveFont(Font.ITALIC));
    typeCombo = new DataStoreTypeCombo();
    typeCombo.addActionListener(this);
    dbNameField.addCaretListener(e -> checkForOverwrite());
    typeCombo.setSelectedItem(DataStoreType.BINARY_XSTREAM);
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JEditorPane(javax.swing.JEditorPane) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) DataStoreTypeCombo(jgnash.ui.components.DataStoreTypeCombo)

Example 3 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class PartialTwo method initComponents.

private void initComponents() {
    table = new PartialTable(qAcc);
    deleteButton = new JButton(rb.getString("Button.Delete"));
    helpPane = new JTextPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("QifTwo.txt"));
    addComponentListener(new ComponentAdapter() {

        @Override
        public void componentShown(ComponentEvent evt) {
            refreshInfo();
        }
    });
    deleteButton.addActionListener(this);
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JTextPane(javax.swing.JTextPane) JButton(javax.swing.JButton) ComponentEvent(java.awt.event.ComponentEvent) ComponentAdapter(java.awt.event.ComponentAdapter)

Example 4 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project jgnash by ccavanaugh.

the class NewFileTwo method initComponents.

private void initComponents() {
    helpPane = new JEditorPane();
    helpPane.setEditable(false);
    helpPane.setEditorKit(new StyledEditorKit());
    helpPane.setBackground(getBackground());
    helpPane.setText(TextResource.getString("NewFileTwo.txt"));
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) JEditorPane(javax.swing.JEditorPane)

Example 5 with StyledEditorKit

use of javax.swing.text.StyledEditorKit in project xsimilarity by iamxiatian.

the class About method createPanel.

public static JPanel createPanel() {
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
    JTextPane editorPane = new JTextPane();
    editorPane.setEditable(false);
    // 让长文本自动换行
    editorPane.setEditorKit(new StyledEditorKit());
    editorPane.setContentType("text/html");
    try {
        // 可以用html格式文件做你的帮助系统了
        URL url = Resources.getResource("about.html");
        editorPane.setPage(url);
    } catch (IOException e1) {
        editorPane.setText(e1.getMessage());
    }
    // editorPane.setText("<html><body>个人主页:<a href='xiatian.irm.cn'>http://xiatian.irm.cn/</a></body></html>");
    mainPanel.add(new JScrollPane(editorPane), BorderLayout.CENTER);
    return mainPanel;
}
Also used : StyledEditorKit(javax.swing.text.StyledEditorKit) IOException(java.io.IOException) URL(java.net.URL)

Aggregations

StyledEditorKit (javax.swing.text.StyledEditorKit)10 JButton (javax.swing.JButton)5 JEditorPane (javax.swing.JEditorPane)5 JTextPane (javax.swing.JTextPane)4 ComponentAdapter (java.awt.event.ComponentAdapter)2 ComponentEvent (java.awt.event.ComponentEvent)2 AccountListComboBox (jgnash.ui.components.AccountListComboBox)2 DefaultUnitConverter (com.jgoodies.forms.util.DefaultUnitConverter)1 Dimension (java.awt.Dimension)1 MouseEvent (java.awt.event.MouseEvent)1 IOException (java.io.IOException)1 URL (java.net.URL)1 JCheckBox (javax.swing.JCheckBox)1 JLabel (javax.swing.JLabel)1 JTextField (javax.swing.JTextField)1 JTree (javax.swing.JTree)1 QifAccount (jgnash.convert.imports.qif.QifAccount)1 Account (jgnash.engine.Account)1 Engine (jgnash.engine.Engine)1 DataStoreTypeCombo (jgnash.ui.components.DataStoreTypeCombo)1