Examples of JTextPane


Examples of javax.swing.JTextPane

  /**
   * This method builds the Gui.
   */
  protected void buildGUI() {
    textPane = new JTextPane();
    textPane.setEditable(false);
    textPane.setAutoscrolls(true);
   
    textPane.addMouseListener(new TextPaneMouseListener());
   
View Full Code Here

Examples of javax.swing.JTextPane

      menuFile.add(closeItem);
      menuBar.add(menuFile);
      getRootPane().setJMenuBar(menuBar);

      textInfoArea = new JTextPane();
      textInfoArea.setFont(new Font("Dialog", Font.PLAIN, 9));
      textInfoArea.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
      textInfoArea.setContentType("text/html");
      textInfoArea.setEditable(false);
View Full Code Here

Examples of javax.swing.JTextPane

  public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
      if (e.getSource() instanceof HyperlinkMouseHandler.URLSelection) {
        HyperlinkMouseHandler.URLSelection selection = (HyperlinkMouseHandler.URLSelection) e.getSource();
        if (selection.editor instanceof JTextPane) {
          JTextPane pane = (JTextPane) selection.editor;
          StyledDocument doc = pane.getStyledDocument();
          StyledEditorKit kit = (StyledEditorKit) pane.getEditorKit();
          MutableAttributeSet attr = kit.getInputAttributes();
          SimpleAttributeSet sas = new SimpleAttributeSet();
          StyleConstants.setUnderline(sas, true);
          doc.setCharacterAttributes(selection.start, (selection.end - selection.start + 1), sas, false);
        }
      }
    } else if (e.getEventType() == HyperlinkEvent.EventType.EXITED) {
      if (e.getSource() instanceof HyperlinkMouseHandler.URLSelection) {
        HyperlinkMouseHandler.URLSelection selection = (HyperlinkMouseHandler.URLSelection) e.getSource();
        if (selection.editor instanceof JTextPane) {
          JTextPane pane = (JTextPane) selection.editor;
          StyledDocument doc = pane.getStyledDocument();
          StyledEditorKit kit = (StyledEditorKit) pane.getEditorKit();
          MutableAttributeSet attr = kit.getInputAttributes();
          SimpleAttributeSet sas = new SimpleAttributeSet();
          StyleConstants.setUnderline(sas, false);
          doc.setCharacterAttributes(selection.start, (selection.end - selection.start + 1), sas, false);
        }
View Full Code Here

Examples of javax.swing.JTextPane

    getTextPaneInstance();
  }

  public synchronized static JTextPane getTextPaneInstance(){
    if(logTextArea == null){
      logTextArea = new JTextPane();
      logTextArea.setEditable(false);
      logTextArea.setDragEnabled(true);
      DefaultCaret caret = (DefaultCaret)logTextArea.getCaret();
      caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
      styledDocument = logTextArea.getStyledDocument();
View Full Code Here

Examples of javax.swing.JTextPane

  /**
   * This creates a new JTextPane for the main text part of the new
   * message.  It will also include the current text of the message.
   */
  public JTextPane createMessagePanel(MessageProxy pProxy) {
    JTextPane retval = new net.suberic.util.swing.ExtendedEditorPane();
    retval.setEditorKit(new MailEditorKit());

    setDefaultFont(retval);

    // see if this message already has a text part, and if so,
    // include it.

    String origText = ((NewMessageInfo)getMessageProxy().getMessageInfo()).getTextPart(false);
    if (origText != null && origText.length() > 0)
      retval.setText(origText);

    UserProfile profile = getSelectedProfile();
    if (profile.autoAddSignature) {
      retval.setCaretPosition(retval.getDocument().getLength());
      if (profile.signatureFirst) {

      }
      addSignature(retval);

View Full Code Here

Examples of javax.swing.JTextPane

        
        setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//TEXT_AREA       
        textInfoScrollPanel.setPreferredSize(new Dimension(300, 100));

        textInfoArea = new JTextPane();
        textInfoArea.setFont(new Font("Dialog", Font.PLAIN, 9));
        textInfoArea.setPreferredSize(new Dimension(300,100));
        textInfoArea.setBorder(new EtchedBorder(EtchedBorder.LOWERED));
        textInfoArea.setContentType("text/html");  
        textInfoArea.setText("<html><head></head><body>"+GuiClient.getApplicationName()+"<br><br>"
View Full Code Here

Examples of javax.swing.JTextPane

//            URL u = MainFrame.class.getClassLoader().getResource("com/googlecode/javacv/procamcalib");
//            JarURLConnection c = (JarURLConnection)u.openConnection();
//            timestamp = c.getManifest().getMainAttributes().getValue("Time-Stamp");
//        } catch (Exception e) { }

        JTextPane textPane = new JTextPane();
  textPane.setEditable(false);
        textPane.setContentType("text/html");
        textPane.setText(
                "<font face=sans-serif><strong><font size=+2>ProCamCalib</font></strong><br>" +
                "build timestamp " + timestamp + "<br>" +
                "Copyright (C) 2009,2010,2011 Samuel Audet &lt;<a href=\"mailto:saudet@ok.ctrl.titech.ac.jp%28Samuel%20Audet%29\">saudet@ok.ctrl.titech.ac.jp</a>&gt;<br>" +
                "Web site: <a href=\"http://www.ok.ctrl.titech.ac.jp/~saudet/procamcalib/\">http://www.ok.ctrl.titech.ac.jp/~saudet/procamcalib/</a><br>" +
                "<br>" +
                "Licensed under the GNU General Public License version 2 (GPLv2).<br>" +
                "Please refer to LICENSE.txt or <a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a> for details."
                );
        textPane.setCaretPosition(0);
        Dimension dim = textPane.getPreferredSize();
        dim.height = dim.width*3/4;
        textPane.setPreferredSize(dim);

        textPane.addHyperlinkListener(new HyperlinkListener() {
            public void hyperlinkUpdate(HyperlinkEvent e) {
                if(e.getEventType() == EventType.ACTIVATED) {
                    try {
                        Desktop.getDesktop().browse(e.getURL().toURI());
                    } catch(Exception ex) {
                        Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,
                                "Could not launch browser to \"" + e.getURL()+ "\"", ex);
                    }
                }
            }
        });

        // pass the scrollpane to the joptionpane.
        JDialog dialog = new JOptionPane(textPane, JOptionPane.PLAIN_MESSAGE).
                createDialog(this, "About");

        if (UIManager.getLookAndFeel().getClass().getName()
                .equals("com.sun.java.swing.plaf.gtk.GTKLookAndFeel")) {
            // under GTK, frameBackground is white, but rootPane color is OK...
            // but under Windows, the rootPane's color is funny...
            Color c = dialog.getRootPane().getBackground();
            textPane.setBackground(new Color(c.getRGB()));
        } else {
            Color frameBackground = this.getBackground();
            textPane.setBackground(frameBackground);
        }
        dialog.setVisible(true);
    }//GEN-LAST:event_aboutMenuItemActionPerformed
View Full Code Here

Examples of javax.swing.JTextPane

//            URL u = MainFrame.class.getClassLoader().getResource("com/googlecode/javacv/procamtracker");
//            JarURLConnection c = (JarURLConnection)u.openConnection();
//            timestamp = c.getManifest().getMainAttributes().getValue("Time-Stamp");
//        } catch (Exception e) { }

        JTextPane textPane = new JTextPane();
  textPane.setEditable(false);
        textPane.setContentType("text/html");
        textPane.setText(
                "<font face=sans-serif><strong><font size=+2>ProCamTracker</font></strong><br>" +
                "build timestamp " + timestamp + "<br>" +
                "Copyright (C) 2009,2010,2011 Samuel Audet &lt;<a href=\"mailto:saudet@ok.ctrl.titech.ac.jp%28Samuel%20Audet%29\">saudet@ok.ctrl.titech.ac.jp</a>&gt;<br>" +
                "Web site: <a href=\"http://www.ok.ctrl.titech.ac.jp/~saudet/procamtracker/\">http://www.ok.ctrl.titech.ac.jp/~saudet/procamtracker/</a><br>" +
                "<br>" +
                "Licensed under the GNU General Public License version 2 (GPLv2).<br>" +
                "Please refer to LICENSE.txt or <a href=\"http://www.gnu.org/licenses/\">http://www.gnu.org/licenses/</a> for details."
                );
        textPane.setCaretPosition(0);
        Dimension dim = textPane.getPreferredSize();
        dim.height = dim.width*3/4;
        textPane.setPreferredSize(dim);

        textPane.addHyperlinkListener(new HyperlinkListener() {
            public void hyperlinkUpdate(HyperlinkEvent e) {
                if(e.getEventType() == EventType.ACTIVATED) {
                    try {
                        Desktop.getDesktop().browse(e.getURL().toURI());
                    } catch(Exception ex) {
                        Logger.getLogger(MainFrame.class.getName()).log(Level.SEVERE,
                                "Could not launch browser to \"" + e.getURL()+ "\"", ex);
                    }
                }
            }
        });

        // pass the scrollpane to the joptionpane.
        JDialog dialog = new JOptionPane(textPane, JOptionPane.PLAIN_MESSAGE).
                createDialog(this, "About");

        if (UIManager.getLookAndFeel().getClass().getName()
                .equals("com.sun.java.swing.plaf.gtk.GTKLookAndFeel")) {
            // under GTK, frameBackground is white, but rootPane color is OK...
            // but under Windows, the rootPane's color is funny...
            Color c = dialog.getRootPane().getBackground();
            textPane.setBackground(new Color(c.getRGB()));
        } else {
            Color frameBackground = this.getBackground();
            textPane.setBackground(frameBackground);
        }
        dialog.setVisible(true);
    }//GEN-LAST:event_aboutMenuItemActionPerformed
View Full Code Here

Examples of javax.swing.JTextPane

        private InputStream inputStream;
        private PrintStream outputStream;
        private PrintStream errorStream;
       
        public ConsoleFacade(String bannerText) {
            textPane = new JTextPane();
      textPane.setMargin(new Insets(4, 4, 0, 4));
            textPane.setCaretColor(new Color(0xa4, 0x00, 0x00));
            textPane.setBackground(new Color(0xf2, 0xf2, 0xf2));
            textPane.setForeground(new Color(0xa4, 0x00, 0x00));
View Full Code Here

Examples of javax.swing.JTextPane

    private static final String MAIN_COLS = "main.cols";

    public MainFrame(final File file, final int limit, final Dimension screenSize) throws FileNotFoundException,
            IOException {

        JTextPane text = Util.showStartupDialog("Reading from " + file, screenSize);

        final RequestTrackerFile dm = new RequestTrackerFile(file, limit, text);

        final JTable table = new JTable(dm);
        table.setAutoCreateRowSorter(true);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.