本文整理汇总了Java中java.awt.TextArea.setForeground方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setForeground方法的具体用法?Java TextArea.setForeground怎么用?Java TextArea.setForeground使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.TextArea
的用法示例。
在下文中一共展示了TextArea.setForeground方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例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);
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);
}
示例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++) {
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);
}