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


Java TextArea.setEditable方法代码示例

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


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

示例1: init

import java.awt.TextArea; //导入方法依赖的package包/类
@Override
public void init() {
    tf = new TextField(20);
    tf.setText("0123456789");
    tf.select(0, 6);

    final TextArea ta = new TextArea("INSTRUCTIONS:\n"
                                     + "The text 012345 should be selected in the TextField.\n"
                                     + "If this is what you observe, then the test passes.\n"
                                     + "Otherwise, the test fails.", 40, 5,
                                     TextArea.SCROLLBARS_NONE);
    ta.setEditable(false);
    ta.setPreferredSize(new Dimension(300, 70));
    final Panel panel = new Panel();
    panel.setLayout(new FlowLayout());
    panel.add(tf);
    setLayout(new BorderLayout());
    add(ta, BorderLayout.CENTER);
    add(panel, BorderLayout.PAGE_END);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:SelectionVisible.java

示例2: actionPerformed

import java.awt.TextArea; //导入方法依赖的package包/类
public void actionPerformed() {
    JFrame f = new JFrame();
    TextArea textArea = new TextArea();
    textArea.setEditable(false);
    textArea.setBackground(Color.white);
    textArea.setForeground(Color.black);
    IData data = accumulatorHistory.getData();
    IData xData = ((DataInfoFunction)accumulatorHistory.getDataInfo()).getXDataSource().getIndependentData(0);
    for (int i=0; i<data.getLength(); i++) {
        double x = xData.getValue(i);
        double y = data.getValue(i);
        if (Double.isNaN(x) || Double.isNaN(y)) continue;
        textArea.append(x+"\t"+y+"\n");
    }
    f.add(textArea);
    f.pack();
    f.setSize(400,600);
    f.setVisible(true);
}
 
开发者ID:etomica,项目名称:etomica,代码行数:20,代码来源:ActionHistoryWindow.java

示例3: actionPerformed

import java.awt.TextArea; //导入方法依赖的package包/类
public void actionPerformed() {
    JFrame f = new JFrame();
    TextArea textArea = new TextArea();
    textArea.setEditable(false);
    textArea.setBackground(Color.white);
    textArea.setForeground(Color.black);
    int nLeaf = leafList.getAtomCount();
    for (int iLeaf=0; iLeaf<nLeaf; iLeaf++) {
        IAtom a = leafList.getAtom(iLeaf);
        Vector pos = a.getPosition();
        String str = Double.toString(pos.getX(0));
        for (int i=1; i<pos.getD(); i++) {
            str += " "+Double.toString(pos.getX(i));
        }
        textArea.append(str+"\n");
    }
    f.add(textArea);
    f.pack();
    f.setSize(400,600);
    f.setVisible(true);
}
 
开发者ID:etomica,项目名称:etomica,代码行数:22,代码来源:ActionConfigWindow.java

示例4: actionPerformed

import java.awt.TextArea; //导入方法依赖的package包/类
public void actionPerformed() {
    JFrame f = new JFrame();
    TextArea textArea = new TextArea();
    textArea.setEditable(false);
    textArea.setBackground(Color.white);
    textArea.setForeground(Color.black);
    int nLeaf = leafList.getAtomCount();
    for (int iLeaf=0; iLeaf<nLeaf; iLeaf++) {
        IAtomKinetic a = (IAtomKinetic)leafList.getAtom(iLeaf);
        Vector vel = a.getVelocity();
        String str = Double.toString(vel.getX(0));
        for (int i=1; i<vel.getD(); i++) {
            str += " "+Double.toString(vel.getX(i));
        }
        textArea.append(str+"\n");
    }
    f.add(textArea);
    f.pack();
    f.setSize(400,600);
    f.setVisible(true);
}
 
开发者ID:etomica,项目名称:etomica,代码行数:22,代码来源:ActionVelocityWindow.java

示例5: init

import java.awt.TextArea; //导入方法依赖的package包/类
@Override
public void init() {
    ta = new TextArea(4, 20);
    ta.setText("01234\n56789");
    ta.select(3, 9);

    final TextArea instruction = new TextArea("INSTRUCTIONS:\n"
                                             + "The text 34567 should be selected in the TextArea.\n"
                                             + "If this is what you observe, then the test passes.\n"
                                             + "Otherwise, the test fails.", 40, 5,
                                     TextArea.SCROLLBARS_NONE);
    instruction.setEditable(false);
    instruction.setPreferredSize(new Dimension(300, 70));
    final Panel panel = new Panel();
    panel.setLayout(new FlowLayout());
    panel.add(ta);
    setLayout(new BorderLayout());
    add(instruction, BorderLayout.CENTER);
    add(panel, BorderLayout.PAGE_END);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:21,代码来源:SelectionVisible.java

示例6: makeGraphicsPanel

import java.awt.TextArea; //导入方法依赖的package包/类
public void makeGraphicsPanel() {
    	graphicPanel = new JPanel();
    	graphicPanel.setLayout(gbLayout);
    	
    	graphicOut2 = new JPanel();
    	graphicOut2.setLayout(new GridLayout(0,(int)((myPanel.getWidth()-60)/100.0),0,0));
        graphicOut2.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED, Color.black, Color.gray)));	   
        graphicOut = new JScrollPane();
//        graphicOut2.addMouseListener(new MouseEventClusterPanel());
        graphicOut.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED, Color.black, Color.gray)));	   

        graphicOut2.setPreferredSize(null);
        graphicOut.setBackground(null);
        graphicOut2.setBackground(null);
        graphicOut.getViewport().setPreferredSize(null);
        graphicOut.getViewport().setBackground(Color.white);
        graphicOut.getViewport().add(graphicOut2);
        gbConst.weightx = 1; gbConst.weighty = 1;
        gbConst.fill = GridBagConstraints.BOTH;
        addComponent(graphicOut,graphicPanel, 0,0,4,1);

        JPanel tmp = new JPanel();
        textAreaForBonds = new TextArea("Bonds of Selected Cluster :", 4, 65);
        textAreaForBonds.append("\n\n");
        textAreaForBonds.append("Weight of Selected Cluster : ");
        textAreaForBonds.setBackground(Color.white);
        textAreaForBonds.setEditable(false);
        tmp.add(textAreaForBonds);
        gbConst.weightx = 0; gbConst.weighty = 0;
        gbConst.fill = GridBagConstraints.BOTH;
        addComponent(tmp,graphicPanel, 1,0,3,1);

        JPanel textPanel = new JPanel(new GridLayout(2,0));
        textPanel.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.RAISED, Color.black, Color.gray)));
        JTextField  jtf = new JTextField();
        jtf.setBackground(Color.lightGray);
        jtf.setText("Total Number of Cluster");
        jtf.setEditable(false);
        textPanel.add(jtf);
        totalNCluster = new JTextField();
        textPanel.add(totalNCluster);
        gbConst.weightx = 0; gbConst.weighty = 0;
        gbConst.fill = GridBagConstraints.BOTH;
        addComponent(textPanel,graphicPanel, 1,3,1,1);
        
        if(firstTimeDrawn) {
        	displayPanel.add("Cluster Diagram Graphics", graphicPanel); firstTimeDrawn= false;        
        } else {
        	displayPanel.remove(0);displayPanel.add(graphicPanel, "Cluster Diagram Graphics",  0);
        }
    }
 
开发者ID:etomica,项目名称:etomica,代码行数:52,代码来源:MyApplet.java


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