本文整理匯總了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);
}