当前位置: 首页>>代码示例>>Java>>正文


Java JTextPane.setEditable方法代码示例

本文整理汇总了Java中javax.swing.JTextPane.setEditable方法的典型用法代码示例。如果您正苦于以下问题:Java JTextPane.setEditable方法的具体用法?Java JTextPane.setEditable怎么用?Java JTextPane.setEditable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JTextPane的用法示例。


在下文中一共展示了JTextPane.setEditable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: About

import javax.swing.JTextPane; //导入方法依赖的package包/类
/**
 * Create the frame.
 */
public About() {
	ImageIcon img = new ImageIcon("icon.PNG");
	this.setIconImage(img.getImage());
	this.setTitle("About");
	setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
	setBounds(100, 100, 705, 335);
	contentPane = new JPanel();
	contentPane.setBackground(SystemColor.activeCaptionBorder);
	contentPane.setToolTipText("erh");
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);
	
	JTextPane txtpnByIkerGarca = new JTextPane();
	txtpnByIkerGarca.setBackground(SystemColor.menu);
	txtpnByIkerGarca.setEditable(false);
	txtpnByIkerGarca.setText("By: Iker Garc\u00EDa Ferrero\r\nDate: 03/01/2017\r\n\r\n--Contact--\r\nMail: [email protected] \r\n\r\nThe source code can be found here:\r\nhttps://github.com/ikergarcia1996/Simple-AI_Ikerg-app_INTELLIGENT_POINTS\r\n\r\nA demostration and explanation can be found here (Spanish):\r\nhttps://www.youtube.com/hardware360grados\r\n\r\nThis program uses Processing 3.2.3\r\n\r\nCopyright 2017 Iker Garc\u00EDa \"Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)\" ");
	txtpnByIkerGarca.setToolTipText("");
	txtpnByIkerGarca.setBounds(12, 13, 664, 262);
	contentPane.add(txtpnByIkerGarca);
}
 
开发者ID:ikergarcia1996,项目名称:Genetic-Algorithm-Path-Finder,代码行数:25,代码来源:About.java

示例2: createInfoPanel

import javax.swing.JTextPane; //导入方法依赖的package包/类
private static JTextPane createInfoPanel(String notification) {
    JTextPane balloon = new JTextPane();
    balloon.setContentType("text/html");
    String text = getDetails(notification).replaceAll("(\r\n|\n|\r)", "<br>");
    balloon.setText(text);
    balloon.setOpaque(false);
    balloon.setEditable(false);
    balloon.setBorder(new EmptyBorder(0, 0, 0, 0));


    if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {
        //#134837
        //http://forums.java.net/jive/thread.jspa?messageID=283882
        balloon.setBackground(new Color(0, 0, 0, 0));
    }

    balloon.addHyperlinkListener(new HyperlinkListener() {

        public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
                URLDisplayer.getDefault().showURL(e.getURL());
            }
        }
    });
    return balloon;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ShowNotifications.java

示例3: initComponents

import javax.swing.JTextPane; //导入方法依赖的package包/类
private void initComponents() {
	Box vBox = Box.createVerticalBox();
	Box hBox = Box.createHorizontalBox();
	synView = new JTextPane();
	synView.setContentType("text/html");
	synView.setEditable(false);
	synScroll = new JScrollPane(synView);
	synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	vBox.add(Box.createVerticalStrut(30));
	vBox.add(hBox);
	vBox.add(Box.createVerticalStrut(30));
	hBox.add(Box.createHorizontalStrut(20));
	hBox.add(synScroll);
	hBox.add(Box.createHorizontalStrut(20));
	this.setLayout(new GridLayout(1, 1));
	this.add(vBox);
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:19,代码来源:SynopsisPanel.java

示例4: HelpWindow

import javax.swing.JTextPane; //导入方法依赖的package包/类
public HelpWindow() {
	super(Main.NAME + ": Help");
	setIconImage(Main.icon);
	final JTextPane text = new JTextPane();
	text.setText("Basic Configuration:\n"
			+ "Create a folder where you will put the shortcuts to display and set it in the settings\n"
			+ "(it should not be the default Desktop folder, as then icons would be displayed twice).\n"
			+ "Fill that folder with subfolders - these will be the different icon groups.\n"
			+ "In each subfolder, place shortcuts to display, or make subfolders if you want to display not only a shortcut,\n"
			+ "but some alternative shortcuts or related data too. This subfolder can be expanded with a right click on the icon later.\n"
			+ "\n"
			+ "Controls:\n"
			+ "Left click on icon: start application or open file\n"
			+ "Right click on icon: show sub-icons (if any)\n"
			+ "Double click on group title: open folder in explorer\n"
			+ "Middle click on icon or group title: rename file or folder");
	text.setEditable(false);
	add(text);
	pack();
}
 
开发者ID:Njol,项目名称:Motunautr,代码行数:21,代码来源:HelpWindow.java

示例5: do_makeTextPane

import javax.swing.JTextPane; //导入方法依赖的package包/类
/** This helper method constructs a JTextPane with the given settings. */
private static JTextPane do_makeTextPane(boolean editable, int topMargin, int bottomMargin, int otherMargin) {
	JTextPane x = OurAntiAlias.pane(Color.BLACK, Color.WHITE, new Font("Verdana", Font.PLAIN, 14));
	x.setEditable(editable);
	x.setAlignmentX(0);
	x.setAlignmentY(0);
	x.setCaretPosition(0);
	x.setMargin(new Insets(topMargin, otherMargin, bottomMargin, otherMargin));
	return x;
}
 
开发者ID:AlloyTools,项目名称:org.alloytools.alloy,代码行数:11,代码来源:OurConsole.java

示例6: initConsole

import javax.swing.JTextPane; //导入方法依赖的package包/类
private static Component initConsole() {
  Logger root = Logger.getLogger("");
  JTextPane consoleTextArea = new JTextPane();
  JScrollPane consoleScrollPane = new JScrollPane();
  consoleScrollPane.setViewportBorder(null);
  consoleScrollPane.setViewportView(consoleTextArea);

  consoleTextArea.setEditable(false);
  consoleTextArea.setBackground(Color.DARK_GRAY);
  consoleTextArea.setAutoscrolls(true);
  root.addHandler(new ConsoleLogHandler(consoleTextArea));
  return consoleScrollPane;
}
 
开发者ID:gurkenlabs,项目名称:litiengine,代码行数:14,代码来源:Program.java

示例7: getPane

import javax.swing.JTextPane; //导入方法依赖的package包/类
private JTextPane getPane(File[] files, File projectDir, String url, String revision) {
    JTextPane bubble = new JTextPane();
    bubble.setOpaque(false);
    bubble.setEditable(false);

    if (UIManager.getLookAndFeel().getID().equals("Nimbus")) {                   //NOI18N
        //#134837
        //http://forums.java.net/jive/thread.jspa?messageID=283882
        bubble.setBackground(new Color(0, 0, 0, 0));
    }

    bubble.setContentType("text/html");                                          //NOI18N
    setupPane(bubble, files, projectDir, url, revision);
    return bubble;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:VCSNotificationDisplayer.java

示例8: getElementsComponent

import javax.swing.JTextPane; //导入方法依赖的package包/类
private JComponent getElementsComponent (String msg) {
    JTextPane area = new JTextPane ();
    area.setEditable (false);
    area.setContentType ("text/html"); // NOI18N
    area.setText (msg);
    area.setOpaque (false);
    area.setBackground(new Color(0, 0, 0, 0));
    area.putClientProperty( JTextPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE );
    return area;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:OperationPanel.java

示例9: setupTextPane

import javax.swing.JTextPane; //导入方法依赖的package包/类
private void setupTextPane(final JTextPane textPane, String comment) {
    if( UIUtils.isNimbus() ) {
        textPane.setUI( new BasicTextPaneUI() );
    }
    textPane.setText(comment);
    
    Caret caret = textPane.getCaret();
    if (caret instanceof DefaultCaret) {
        ((DefaultCaret)caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
    }

    // attachments
    if (!attachmentIds.isEmpty()) {
        AttachmentHyperlinkSupport.Attachement a = AttachmentHyperlinkSupport.findAttachment(comment, attachmentIds);
        if (a != null) {
            String attachmentId = a.id;
            if (attachmentId != null) {
                int index = attachmentIds.indexOf(attachmentId);
                if (index != -1) {
                    BugzillaIssue.Attachment attachment = attachments.get(index);
                    AttachmentLink attachmentLink = new AttachmentLink(attachment);
                    HyperlinkSupport.getInstance().registerLink(textPane, new int[] {a.idx1, a.idx2}, attachmentLink);
                } else {
                    Bugzilla.LOG.log(Level.WARNING, "couldn''t find attachment id in: {0}", comment); // NOI18N
                }
            }
        }
    }

    // pop-ups
    textPane.setComponentPopupMenu(commentsPopup);

    textPane.setBackground(blueBackground);

    textPane.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
    textPane.setEditable(false);
    textPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleName")); // NOI18N
    textPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleDescription")); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:CommentsPanel.java

示例10: ROCViewer

import javax.swing.JTextPane; //导入方法依赖的package包/类
public ROCViewer(AreaUnderCurve auc) {
	setLayout(new BorderLayout());

	String message = auc.toString();

	criterionName = auc.getName();

	// info string
	JPanel infoPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
	infoPanel.setOpaque(true);
	infoPanel.setBackground(Colors.WHITE);
	JTextPane infoText = new JTextPane();
	infoText.setEditable(false);
	infoText.setBackground(infoPanel.getBackground());
	infoText.setFont(infoText.getFont().deriveFont(Font.BOLD));
	infoText.setText(message);
	infoPanel.add(infoText);
	add(infoPanel, BorderLayout.NORTH);

	// plot panel
	plotter = new ROCChartPlotter();
	plotter.addROCData("ROC", auc.getRocData());
	JPanel innerPanel = new JPanel(new BorderLayout());
	innerPanel.add(plotter, BorderLayout.CENTER);
	innerPanel.setBorder(BorderFactory.createMatteBorder(5, 0, 10, 10, Colors.WHITE));
	add(innerPanel, BorderLayout.CENTER);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:28,代码来源:ROCViewer.java

示例11: LicensesWindow

import javax.swing.JTextPane; //导入方法依赖的package包/类
/**
 * <p>Create and show a new LicensesWindow.</p>
 * @param parent The JFrame that should be the parent of this dialog.
 * @param isModal Does the dialog have to be closed before the user can interact with the parent?
 * */
public LicensesWindow(JFrame parent, boolean isModal) {
	super(parent, isModal);
	setBounds(100, 100, 600, 300); //Set the size of the dialog.
	setLocationRelativeTo(parent); //Center the dialog relative to the parent.  If you don't do this, the dialog will appear where the first JFrame spawned by the program did, and at the upper left corner.  It's disconcerting.
	setTitle("Licenses");
	JTextPane textPane = new JTextPane(); //Create a TextPane to show the licenses.
	textPane.setEditable(false); //The licenses are fixed.
	textPane.setContentType("text/html"); //Display the licenses as HTML to use hard returns and bold text.
	textPane.setText("<b>JSyntaxPane is available under the Apache License version 2.0</b><br><br>Copyright 2008 Ayman Al-Sairafi [email protected]<br><br>Apache License<br><br>Version 2.0, January 2004<br><br>http://www.apache.org/licenses/<br><br>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION<br><br>1. Definitions.<br><br>\"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.<br><br>\"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.<br><br>\"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.<br><br>\"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.<br><br>\"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.<br><br>\"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.<br><br>\"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).<br><br>\"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.<br><br>\"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"<br><br>\"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.<br><br>2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.<br><br>3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.<br><br>4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:<br><br>    You must give any other recipients of the Work or Derivative Works a copy of this License; and<br><br>    You must cause any modified files to carry prominent notices stating that You changed the files; and<br><br>    You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and<br><br>    If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.<br><br>5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.<br><br>6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.<br><br>7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.<br><br>8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.<br><br>9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.<br><br>END OF TERMS AND CONDITIONS<br><br><b>IAN is available under the MIT License</b><br><br>Copyright (c) 2016 Robert J. Walker<br><br>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<br><br>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<br><br>THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.");
	textPane.setCaretPosition(0); //Scroll right to the top.
	setContentPane(new JScrollPane(textPane)); //Wrap the text in a JScrollPane because it will probably overflow.
	setVisible(true); //Show the dialog.
}
 
开发者ID:Michaelkielstra,项目名称:Diana,代码行数:19,代码来源:LicensesWindow.java

示例12: init

import javax.swing.JTextPane; //导入方法依赖的package包/类
private void init() {
    txpText = new JTextPane();
    txpLines = new JTextPane();

    // needed for correct layouting
    Insets ins = txpLines.getInsets();
    txpLines.setMargin(new Insets(ins.top + 1, ins.left, ins.bottom, ins.right));

    textHighlighter = new BookmarkHighlighter();
    lineHighlighter = new BookmarkHighlighter();

    txpText.setHighlighter(textHighlighter);
    //txpText.setMinimumSize(new Dimension(100, 100));
    txpText.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    txpText.setEditable(false);

    txpLines.setHighlighter(lineHighlighter);
    txpLines.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 12));
    txpLines.setBackground(Color.LIGHT_GRAY);
    txpLines.setEnabled(false);
    txpLines.setForeground(Color.BLACK);
    txpLines.addMouseListener(mouseInputListener);

    fm = txpText.getFontMetrics(txpText.getFont());

    JPanel pnlBookmarks = new JPanel();
    pnlBookmarks.setLayout(new BorderLayout());
    pnlBookmarks.add(txpText, BorderLayout.CENTER);

    JScrollPane jspBookmarks = new JScrollPane(pnlBookmarks);
    jspBookmarks.setRowHeaderView(txpLines);
    jspBookmarks.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    jspBookmarks.getVerticalScrollBar().setUnitIncrement(15);

    this.setLayout(new BorderLayout());
    this.add(jspBookmarks, BorderLayout.CENTER);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:38,代码来源:BookmarkableLogViewer.java

示例13: createTextPane

import javax.swing.JTextPane; //导入方法依赖的package包/类
/** Callback factory method for a fresh HTML-enabled text pane. */
protected JTextPane createTextPane() {
    JTextPane result = new JTextPane();
    result.setContentType("text/html");
    result.setEditable(false);
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:8,代码来源:HelpFactory.java

示例14: initComponents

import javax.swing.JTextPane; //导入方法依赖的package包/类
private void initComponents() {
	Box vBox = Box.createVerticalBox();
	Box hBox = Box.createHorizontalBox();
	Box h2Box = Box.createHorizontalBox();
	JLabel descrLabel = new JLabel(DESCRIPTION_PANEL);
	button_save = new JButton(ACTION_SAVE);
	button_save.setEnabled(false);

	synView = new JTextPane();
	synView.setContentType("text/html");
	synView.setEditable(false);

	synScroll = new JScrollPane(synView);
	synScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	synScroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
	vBox.add(Box.createVerticalStrut(20));
	vBox.add(h2Box);
	vBox.add(Box.createVerticalStrut(20));
	vBox.add(synScroll);
	vBox.add(Box.createVerticalStrut(20));
	//h2Box.add(Box.createHorizontalStrut(20));
	h2Box.add(descrLabel);
	h2Box.add(button_save);
	hBox.add(Box.createHorizontalStrut(20));
	hBox.add(vBox);
	hBox.add(Box.createHorizontalStrut(20));
	// h2Box.setMaximumSize(new Dimension(580,50));
	this.setLayout(new GridLayout(1, 1));
	this.add(hBox);
	synView
			.setText("<html><body><center><font face=\"bold\" size=\"3\">Burstiness values will be here displayed once you solve the problem.</font></center></body></html>");
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:33,代码来源:TextualPanel.java

示例15: setHeader

import javax.swing.JTextPane; //导入方法依赖的package包/类
private static void setHeader(JPanel panel) {
  JTextPane header = new JTextPane();
  Insets inset = new Insets(0, 0, 0, 5);
  header.setPreferredSize(new Dimension(80, 15));
  header.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  header.setEditable(false);
  header.setText("10:00");
  header.setMargin(inset);
  header.setBackground(Color.lightGray);
  panel.add(header);
}
 
开发者ID:vaclav,项目名称:voicemenu,代码行数:12,代码来源:Style.java


注:本文中的javax.swing.JTextPane.setEditable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。