javax.swing.text.JTextComponent.setEditable()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(204)

本文整理了Java中javax.swing.text.JTextComponent.setEditable()方法的一些代码示例,展示了JTextComponent.setEditable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.setEditable()方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:setEditable

JTextComponent.setEditable介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

m_totalTf.setEditable(false);
JPanel content = new JPanel();
content.setLayout(new FlowLayout());
content.add(new JLabel("Input"));
content.add(m_userInputTf);
content.add(m_multiplyBtn);
content.add(new JLabel("Total"));
content.add(m_totalTf);
this.pack();
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Creates a new <code>DetailPanel</code> instance.
 *
 * @param aTable the table to listen for selections on
 * @param aModel the model backing the table
 */
DetailPanel(JTable aTable, final MyTableModel aModel) {
  mModel = aModel;
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Details: "));
  mDetails = new JEditorPane();
  mDetails.setEditable(false);
  mDetails.setContentType("text/html");
  add(new JScrollPane(mDetails), BorderLayout.CENTER);
  final ListSelectionModel rowSM = aTable.getSelectionModel();
  rowSM.addListSelectionListener(this);
}

代码示例来源:origin: stackoverflow.com

int height = 100;
gui = new JPanel(new BorderLayout(3,4));
gui.add(quality, BorderLayout.WEST);
JPanel controls = new JPanel(new GridLayout(0,1,0,0));
antialiasing = new JCheckBox("Anti-aliasing", false);
rendering = new JCheckBox("Rendering - Quality", true);
dithering = new JCheckBox("Dithering", false);
controls.add(antialiasing);
controls.add(fractionalMetrics);
JPanel lcdContrastPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
lcdContrastPanel.add(textLcdContrast);
lcdContrastPanel.add(new JLabel("Text LCD Contrast"));
gui.add(images, BorderLayout.CENTER);
output = new JTextArea(4,40);
output.setEditable(false);
gui.add(new JScrollPane(output), BorderLayout.SOUTH);

代码示例来源:origin: stackoverflow.com

import java.io.IOException;
import javax.swing.*;

public class ExempleText {

  public static void main(String[] args) {
    String url = "C:/Users/Nimit/Desktop/n.txt";
    try {
      JFrame frame=new JFrame("Hi");
      JEditorPane Pane = new JEditorPane(url);
      Pane.setEditable(false);
      frame.add(new JScrollPane(Pane));
    } catch(IOException ioe) {
      System.err.println("Error displaying " + url);
      ioe.printStackTrace();
    }
  }
}

代码示例来源:origin: stackoverflow.com

e.setVisible(true);         
web.setEditable(false);
getContentPane().add(scrollPane);
this.setBounds( 0, 0, 200, 200);

代码示例来源:origin: stackoverflow.com

ta.setFont(font);
ta.setText(fontText);
ta.setEditable(false);
JEditorPane op = new JEditorPane();
op.setContentType("text/html");
op.setEditable(false);
JPanel fontTable = new JPanel(new BorderLayout(3, 1));
JPanel fontNameCol = new JPanel(new GridLayout(0, 1, 2, 2));
JPanel fontExampleCol = new JPanel(new GridLayout(0, 1, 2, 2));
fontTable.add(fontNameCol, BorderLayout.WEST);
fontTable.add(fontExampleCol, BorderLayout.CENTER);
for (int ii = 0; ii < fonts.length; ii++) {
  fontNameCol.add(new JLabel(fonts[ii]));
  fontExampleCol.add(getExampleOfFont(fonts[ii]));
p.add(tabPane, BorderLayout.CENTER);
p.setPreferredSize(new Dimension(400, 400));
JFrame f = new JFrame("Properties");
f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
f.getContentPane().add(p, BorderLayout.CENTER);
f.pack();
f.setMinimumSize(f.getPreferredSize());
f.setSize(600, 500);
f.setLocationRelativeTo(null);
f.setVisible(true);

代码示例来源:origin: stackoverflow.com

setEditable(false);
setForeground(standardColor);
setBorder(standardBorder);
JPanel p = new JPanel(new GridLayout(0,1));
File f = new File(".","LinkLabel.java");
p.add(linkLabelFile);
p.add(linkLabelWeb);
JPanel labelConstrain = new JPanel(new BorderLayout());
labelConstrain.add( linkLabelConstrain, BorderLayout.EAST );
p.add(labelConstrain);

代码示例来源:origin: net.sf.jt400/jt400

public ScrollingTextPane(boolean editable)
{
  textPane_ = new JTextPane();
  textPane_.setEditable(editable);
  setLayout(new BorderLayout());
  add("Center", new JScrollPane(textPane_));
}

代码示例来源:origin: stackoverflow.com

import java.io.*;
import java.net.*;
import java.util.regex.*;
import javax.swing.*;

public class webloader {
  static JComponent page;
  public static void loadcode(){
    JEditorPane jep = new JEditorPane();
     jep.setEditable(false);   

     try {
      jep.setPage("http://(server):(port)/" + web.url);
     }
     catch (IOException e) {
      jep.setContentType("text/html");
      jep.setText("<html>Could not load webpage</html>");
     } 

     JScrollPane scrollPane = new JScrollPane(jep);     
     JFrame f = new JFrame(web.url);
     f.getContentPane().add(scrollPane);
     f.setSize(512, 342);
     f.show();
  }
}

代码示例来源:origin: stackoverflow.com

JFrame frame = new JFrame("WindowCommunication");
frame.getContentPane().add(new MyFramePanel());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
field.setEditable(false);
field.setFocusable(false);
add(field);
add(openDialogeBtn);
        ModalityType.APPLICATION_MODAL);
   dialog.getContentPane().add(dialogPanel);
   dialog.pack();
   dialog.setLocationRelativeTo(null);

代码示例来源:origin: net.sf.jt400/jt400

JPanel statusBar = new JPanel();
pageInfo_.setEditable(false);
pageInfo_.transferFocus();
zoomInfo_.setEditable(false);
zoomInfo_.transferFocus();
statusBar.add(pageInfo_);
statusBar.add(zoomInfo_);

代码示例来源:origin: stackoverflow.com

import javax.swing.*;
import java.awt.*;

public class PreviewClass extends JPanel{
  private JTextField namePreview;

  /**
   * @param namePreview the namePreview to set
   */
  public void setNamePreview(String textContent) {
    this.namePreview.setText(textContent);
  }

  public PreviewClass() {
     setLayout(new FlowLayout());

     namePreview=new JTextField(15);
     namePreview.setEditable(false);

     add(namePreview);
  }

}

代码示例来源:origin: stackoverflow.com

jep.setText("Welcome to <a href='http://stackoverflow.com/'>StackOverflow</a>.");
jep.setEditable(false);//so its not editable
jep.setOpaque(false);//so we dont see whit background
JFrame f = new JFrame("HyperlinkListener");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(jep);
f.pack();
f.setVisible(true);

代码示例来源:origin: stackoverflow.com

textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
textArea.setEditable(false);
textArea.setFocusable(false);
JPanel panel = new JPanel(new BorderLayout(3,3));
panel.add(button, BorderLayout.NORTH);
panel.add(new JScrollPane(textArea), BorderLayout.CENTER);

代码示例来源:origin: org.apache.log4j/com.springsource.org.apache.log4j

/**
 * Creates a new <code>DetailPanel</code> instance.
 *
 * @param aTable the table to listen for selections on
 * @param aModel the model backing the table
 */
DetailPanel(JTable aTable, final MyTableModel aModel) {
  mModel = aModel;
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Details: "));
  mDetails = new JEditorPane();
  mDetails.setEditable(false);
  mDetails.setContentType("text/html");
  add(new JScrollPane(mDetails), BorderLayout.CENTER);
  final ListSelectionModel rowSM = aTable.getSelectionModel();
  rowSM.addListSelectionListener(this);
}

代码示例来源:origin: stackoverflow.com

this.setBackground(new Color(0, 0, 0, alpha));
this.setFont(new Font("Serif", Font.ITALIC, 24));
this.setEditable(false);
this.setText("Twas brillig and the slithy toves,\n"
  + "Did gyre and gimble in the wabe;\n"
JFrame f = new JFrame();
f.setLayout(new FlowLayout());
f.getContentPane().setBackground(new Color(0xffffc0));
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setBackground(new Color(0xffffc0));
panel.add(new TransparentTextArea(0));
jif.add(panel);
jif.setVisible(true);
f.add(jif);
f.pack();
f.setVisible(true);

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.log4j

/**
 * Creates a new <code>DetailPanel</code> instance.
 *
 * @param aTable the table to listen for selections on
 * @param aModel the model backing the table
 */
DetailPanel(JTable aTable, final MyTableModel aModel) {
  mModel = aModel;
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Details: "));
  mDetails = new JEditorPane();
  mDetails.setEditable(false);
  mDetails.setContentType("text/html");
  add(new JScrollPane(mDetails), BorderLayout.CENTER);
  final ListSelectionModel rowSM = aTable.getSelectionModel();
  rowSM.addListSelectionListener(this);
}

代码示例来源:origin: stackoverflow.com

display.setEditable( false );
display.setHorizontalAlignment(JTextField.RIGHT);
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout( new GridLayout(0, 5) );
buttons = new JButton[10];
  button.setMnemonic( text.charAt(0) );
  buttons[i] = button;
  buttonPanel.add( button );
getContentPane().add(display, BorderLayout.NORTH);
getContentPane().add(buttonPanel, BorderLayout.SOUTH);
setResizable( false );
frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
frame.pack();
frame.setLocationRelativeTo( null );
frame.setVisible(true);

代码示例来源:origin: org.apache/log4j

/**
 * Creates a new <code>DetailPanel</code> instance.
 *
 * @param aTable the table to listen for selections on
 * @param aModel the model backing the table
 */
DetailPanel(JTable aTable, final MyTableModel aModel) {
  mModel = aModel;
  setLayout(new BorderLayout());
  setBorder(BorderFactory.createTitledBorder("Details: "));
  mDetails = new JEditorPane();
  mDetails.setEditable(false);
  mDetails.setContentType("text/html");
  add(new JScrollPane(mDetails), BorderLayout.CENTER);
  final ListSelectionModel rowSM = aTable.getSelectionModel();
  rowSM.addListSelectionListener(this);
}

代码示例来源:origin: stackoverflow.com

textField.setEditable(false);
JPanel panel = new JPanel();
panel.add(textField);
panel.add(showDialogBtn);
add(panel);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
JPanel panel = new JPanel();
panel.add(textfield);
panel.add(confirmBtn);
add(panel);
pack();
setLocationRelativeTo(frame);

相关文章

JTextComponent类方法