本文整理汇总了Java中javax.swing.JTextArea.setRows方法的典型用法代码示例。如果您正苦于以下问题:Java JTextArea.setRows方法的具体用法?Java JTextArea.setRows怎么用?Java JTextArea.setRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.JTextArea
的用法示例。
在下文中一共展示了JTextArea.setRows方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndShowGUI
import javax.swing.JTextArea; //导入方法依赖的package包/类
private static void createAndShowGUI() {
frame = new JFrame();
final JScrollPane jScrollPane1 = new JScrollPane();
ta = new JTextArea();
ta.setEditable(false);
ta.setColumns(20);
ta.setRows(5);
jScrollPane1.setViewportView(ta);
frame.add(ta);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
示例2: createDetailsSection
import javax.swing.JTextArea; //导入方法依赖的package包/类
private JComponent createDetailsSection()
{
final JLabel notesLabel = new JLabel(getString("label.notes")); //$NON-NLS-1$
notes = new JTextArea();
notes.setWrapStyleWord(true);
notes.setLineWrap(true);
notes.setRows(3);
notes.setBorder(new EmptyBorder(0, 0, 10, 0));
final int height1 = notesLabel.getPreferredSize().height;
final int height2 = notes.getPreferredSize().height;
final int[] rows = {height1, height2};
final int[] cols = {TableLayout.FILL};
final JPanel all = new JPanel(new TableLayout(rows, cols));
all.add(notesLabel, new Rectangle(0, 0, 1, 1));
all.add(new JScrollPane(notes), new Rectangle(0, 1, 1, 1));
return all;
}
示例3: createDataDisplay
import javax.swing.JTextArea; //导入方法依赖的package包/类
private void createDataDisplay() {
dataDisplay = new JPanel(new BorderLayout());
dataDisplay.setBorder( BorderFactory.createEmptyBorder(1, 1, 1, 1));
kountLabel = new JLabel("<html>0 events<br> 0 shown</html>");
kountLabel.setForeground( Color.black);
kountLabel.setFont( new Font( "SansSerif", Font.PLAIN, 12));
kountLabel.setBorder(BorderFactory.createLineBorder(Color.GRAY, 2));
dataDisplay.add(kountLabel, BorderLayout.WEST);
dataTextArea = new JTextArea(" ");
dataTextArea.setEditable(false);
dataTextArea.setRows(2);
dataTextArea.setBorder( BorderFactory.createEmptyBorder(1, 4, 1, 1));
dataTextArea.setFont(dataTextArea.getFont().deriveFont(10f));
dataDisplay.add(dataTextArea);
}
示例4: createCommandField
import javax.swing.JTextArea; //导入方法依赖的package包/类
@Override
protected JTextComponent createCommandField() {
JTextArea res = new DynamicWidthTA();
res.setRows(1);
res.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 1));
// disable default Swing's Ctrl+Shift+O binding to enable our global action
InputMap curIm = res.getInputMap(JComponent.WHEN_FOCUSED);
while (curIm != null) {
curIm.remove(KeyStroke.getKeyStroke(
KeyEvent.VK_O, KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK));
curIm = curIm.getParent();
}
return res;
}
示例5: createMessageArea
import javax.swing.JTextArea; //导入方法依赖的package包/类
private JScrollPane createMessageArea()
{
messages = new JTextArea();
messages.setBorder(BorderFactory.createLineBorder(Color.BLACK));
messages.setBackground(Color.black);
messages.setForeground(Color.green);
messages.setRows(10);
messages.setLineWrap(true);
scroller = new JScrollPane(messages);
return scroller;
}
示例6: getCustomEditor
import javax.swing.JTextArea; //导入方法依赖的package包/类
@Override
public Component getCustomEditor () {
if (customEditor == null) {
JTextArea textArea = new JTextArea();
textArea.setWrapStyleWord(true);
textArea.setLineWrap(true);
textArea.setColumns(60);
textArea.setRows(8);
textArea.getDocument().addDocumentListener(this);
textArea.getAccessibleContext().setAccessibleName(
NbBundle.getBundle(StringEditor.class).getString("ACSN_StringEditorTextArea")); //NOI18N
textArea.getAccessibleContext().setAccessibleDescription(
NbBundle.getBundle(StringEditor.class).getString("ACSD_StringEditorTextArea")); //NOI18N
JScrollPane scroll = new JScrollPane();
scroll.setViewportView(textArea);
JLabel htmlTipLabel = new JLabel(NbBundle.getMessage(StringEditor.class, "StringEditor.htmlTipLabel.text")); // NOI18N
JPanel panel = new JPanel();
GroupLayout layout = new GroupLayout(panel);
layout.setAutoCreateGaps(true);
panel.setLayout(layout);
layout.setHorizontalGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup()
.addComponent(scroll)
.addComponent(htmlTipLabel))
.addContainerGap());
layout.setVerticalGroup(layout.createSequentialGroup()
.addContainerGap().addComponent(scroll).addComponent(htmlTipLabel));
customEditor = panel;
textComp = textArea;
htmlTipLabel.setVisible(htmlText);
}
textComp.setEditable(editable);
setValueToCustomEditor();
return customEditor;
}
示例7: problemPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
private static JPanel problemPanel(String header, String message) {
JPanel panel = new JPanel();
JLabel jLabel1 = new javax.swing.JLabel();
JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
JTextArea jTextArea1 = new javax.swing.JTextArea();
jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
jLabel1.setText(header);
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setLineWrap(true);
jTextArea1.setWrapStyleWord(true);
jTextArea1.setRows(5);
jTextArea1.setText(message);
jTextArea1.setOpaque(false);
jScrollPane1.setViewportView(jTextArea1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(panel);
panel.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(107, 107, 107)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
.addGap(82, 82, 82))
);
return panel;
}
示例8: problemPanel
import javax.swing.JTextArea; //导入方法依赖的package包/类
private static JPanel problemPanel(String header, String message) {
JPanel panel = new JPanel();
JLabel jLabel1 = new javax.swing.JLabel();
JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
JTextArea jTextArea1 = new javax.swing.JTextArea();
jLabel1.setFont(jLabel1.getFont().deriveFont(jLabel1.getFont().getStyle() | java.awt.Font.BOLD));
jLabel1.setText(header);
jTextArea1.setColumns(20);
jTextArea1.setEditable(false);
jTextArea1.setLineWrap(true);
jTextArea1.setWrapStyleWord(true);
jTextArea1.setRows(5);
jTextArea1.setText(message);
jTextArea1.setOpaque(false);
jScrollPane1.setViewportView(jTextArea1);
javax.swing.GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(107, 107, 107)))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
.addGap(82, 82, 82))
);
return panel;
}
示例9: initComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
private void initComponents() {
Box mainBox = Box.createVerticalBox();
Box centralBox = Box.createHorizontalBox();
// Pannello dei componenti univariate statistics panel
JPanel componentsPanel = new JPanel(new BorderLayout(0, 5));
setLayout(new GridLayout(1, 1));
mainBox.add(Box.createVerticalStrut(10));
mainBox.add(centralBox);
mainBox.add(Box.createVerticalStrut(10));
add(mainBox);
// components univariate statistics panel
if (distribution == EXPO) {
componentsPanel.add(new JLabel("Results of fitting of exponential distribution"), BorderLayout.NORTH);
} else {
componentsPanel.add(new JLabel("Results of fitting of Pareto distribution"), BorderLayout.NORTH);
}
resultfittingScrollPane = new JScrollPane();
resultfittingTextArea = new JTextArea();
resultfittingTextArea.setColumns(20);
resultfittingTextArea.setRows(5);
resultfittingScrollPane.setViewportView(resultfittingTextArea);
componentsPanel.add(resultfittingScrollPane, BorderLayout.CENTER);
graphicspanel = new JPanel(new GridLayout(1,3));
graphicspanel.setSize(new Dimension(200,100));
panelqqplot = new JPanel(new BorderLayout());
panelqqplot.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "QQ-plot"));
panelcdf = new JPanel(new BorderLayout());
panelcdf.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "CDF"));
panelpdf = new JPanel(new BorderLayout());
panelpdf.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "pdf"));
qqplot = new SmallQQPlot(model,engfitting);
qqplot.setDistribution(distribution);
cdfplot = new SmallCDF(model, engfitting);
cdfplot.setDistribution(distribution);
pdfplot = new SmallPDF(model, engfitting);
//just to try
panelqqplot.add(qqplot);
panelcdf.add(cdfplot);
panelpdf.add(pdfplot);
graphicspanel.add(panelqqplot);
graphicspanel.add(panelcdf);
graphicspanel.add(panelpdf);
graphicspanel.setPreferredSize(new Dimension(300,240));
componentsPanel.add(graphicspanel, BorderLayout.SOUTH);
centralBox.add(componentsPanel);
}
示例10: initComponents
import javax.swing.JTextArea; //导入方法依赖的package包/类
private void initComponents() {
Box mainBox = Box.createVerticalBox();
Box centralBox = Box.createHorizontalBox();
// Pannello dei componenti univariate statistics panel
JPanel componentsPanel = new JPanel(new BorderLayout(0, 5));
setLayout(new GridLayout(1, 1));
mainBox.add(Box.createVerticalStrut(10));
mainBox.add(centralBox);
mainBox.add(Box.createVerticalStrut(10));
add(mainBox);
// Pannello dei componenti univariate statistics panel
if(distribution == EXPO)
componentsPanel.add(new JLabel("Results of fitting of exponential distribution"), BorderLayout.NORTH);
else if(distribution == PARETO)
componentsPanel.add(new JLabel("Results of fitting of Pareto distribution"), BorderLayout.NORTH);
resultfittingScrollPane = new JScrollPane();
resultfittingTextArea = new JTextArea();
resultfittingTextArea.setColumns(20);
resultfittingTextArea.setRows(5);
resultfittingScrollPane.setViewportView(resultfittingTextArea);
componentsPanel.add(resultfittingScrollPane, BorderLayout.CENTER);
graphicspanel = new JPanel(new GridLayout(1,3));
graphicspanel.setSize(new Dimension(200,100));
panelqqplot = new JPanel(new BorderLayout());
panelqqplot.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "QQ-plot"));
panelcdf = new JPanel(new BorderLayout());
panelcdf.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "CDF"));
panelpdf = new JPanel(new BorderLayout());
panelpdf.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED), "pdf"));
qqplot = new SmallQQPlot(model,engfitting);
qqplot.setDistribution(distribution);
cdfplot = new SmallCDF(model, engfitting);
cdfplot.setDistribution(distribution);
pdfplot = new SmallPDF(model, engfitting);
//just to try
panelqqplot.add(qqplot);
panelcdf.add(cdfplot);
panelpdf.add(pdfplot);
graphicspanel.add(panelqqplot);
graphicspanel.add(panelcdf);
graphicspanel.add(panelpdf);
graphicspanel.setPreferredSize(new Dimension(300,240));
componentsPanel.add(graphicspanel, BorderLayout.SOUTH);
centralBox.add(componentsPanel);
}