本文整理了Java中java.awt.Button.setLabel()
方法的一些代码示例,展示了Button.setLabel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setLabel()
方法的具体详情如下:
包路径:java.awt.Button
类名称:Button
方法名:setLabel
暂无
代码示例来源:origin: net.sf.jt400/jt400
/**
* Sets the text for the Cancel button.
*
* @param buttonText The text to use for the Cancel button.
**/
public void setCancelButtonText(String buttonText)
{
cancel.setLabel(buttonText);
}
代码示例来源:origin: org.fudaa.edu.auburn.vgj/vgj
private void buttonLabels_()
{
okButton.setLabel("Apply");
cancelButton.setLabel("Done");
}
代码示例来源:origin: openmicroscopy/bioformats
/** Toggles whether the data browser is animating. */
public void toggleAnimation() {
animate.setLabel(anim ? "Animate" : "Stop");
anim = !anim;
}
代码示例来源:origin: net.sf.jt400/jt400
/**
* Sets the button text for the Ok button.
*
* @param buttonText The text to use for the Ok button.
**/
public void setOkButtonText(String buttonText)
{
open.setLabel(buttonText);
}
代码示例来源:origin: ome/bio-formats_plugins
/** Toggles whether the data browser is animating. */
public void toggleAnimation() {
animate.setLabel(anim ? "Animate" : "Stop");
anim = !anim;
}
代码示例来源:origin: stackoverflow.com
Button button2 = this.createButton();
button2.setLabel("EDIT");
profilo_2.add(button2);
代码示例来源:origin: org.w3c.jigsaw/jigsaw
protected void setLabel(String s) {
if(s.equals("")) {
widget.setLabel("WARNING: No password, click to edit");
} else {
char c[] = new char[s.length()];
for(int i=0; i<s.length(); i++)
c[i] = '*';
widget.setLabel(new String(c));
}
}
代码示例来源:origin: org.jacorb/jacorb
public void _init(CloseButtonPanelController _controller, String _buttonLabel) {
controller = _controller;
buttonLabel = _buttonLabel;
getCloseButton().setLabel(" "+buttonLabel+" ");
}
/**
代码示例来源:origin: org.junit/com.springsource.junit
protected void runFailed(String message) {
showStatus(message);
fRun.setLabel("Run");
fRunner= null;
}
代码示例来源:origin: stackoverflow.com
final Iterator<Button> buttonI = buttons.iterator();
final Iterator<Territory> territoryI = territories.iterator();
while (territoryI.hasNext() && buttonI.hasNext()) {
final Button button = buttonI.next();
final Territory territory = territoryI.next();
button.setBackground(territory.getOwner().getColor());
button.setLabel(territory.units());
}
代码示例来源:origin: ravn/jsocks
private void onDisconnect() {
synchronized (net_lock) {
mode = COMMAND_MODE;
connect_button.setLabel("Connect");
accept_button.setLabel("Accept");
udp_button.setLabel("UDP");
accept_button.setEnabled(true);
connect_button.setEnabled(true);
udp_button.setEnabled(true);
server_sock = null;
sock = null;
out = null;
in = null;
net_thread = null;
}
}
代码示例来源:origin: org.fudaa.edu.auburn.vgj/vgj
private void hideAll_()
{
label1.hide();
text1.hide();
label2.hide();
text2.hide();
okButton.setLabel("Find");
cancelButton.setLabel("Find Backwards");
}
代码示例来源:origin: sc.fiji/Image_5D
@Override
public void actionPerformed(final ActionEvent e) {
if (e.getSource() == colorButton) {
if (colorChooserDisplayed) {
remove(cColorChooser);
colorButton.setLabel(BUTTON_ACTIVATE_COLOR_CHOOSER);
colorChooserDisplayed = false;
win.pack();
}
else {
add(cColorChooser, BorderLayout.EAST);
colorButton.setLabel(BUTTON_DEACTIVATE_COLOR_CHOOSER);
colorChooserDisplayed = true;
win.pack();
}
}
}
代码示例来源:origin: sc.fiji/Simple_Neurite_Tracer
@Override
public void run() {
analyzeButton.setEnabled(false);
analyzeButton.setLabel("Running Analysis. Please wait...");
results.analyzeWithShollAnalysisPlugin(getExportPath(), shollpafm.getPathsStructured().length);
analyzeButton.setLabel("Analyze Profile (Sholl Analysis v" + Sholl_Utils.version() + ")...");
analyzeButton.setEnabled(true);
}
});
代码示例来源:origin: org.junit/com.springsource.junit
public void run() {
fTestResult= createTestResult();
fTestResult.addListener(TestRunner.this);
fProgressIndicator.start(testSuite.countTestCases());
showInfo("Running...");
long startTime= System.currentTimeMillis();
testSuite.run(fTestResult);
if (fTestResult.shouldStop()) {
showStatus("Stopped");
} else {
long endTime= System.currentTimeMillis();
long runTime= endTime-startTime;
showInfo("Finished: " + elapsedTimeAsString(runTime) + " seconds");
}
fTestResult= null;
fRun.setLabel("Run");
fRunner= null;
System.gc();
}
};
代码示例来源:origin: org.jacorb/jacorb
/**
* Return the ClearButton property value.
* @return java.awt.Button
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.Button getClearButton() {
if (ivjClearButton == null) {
try {
ivjClearButton = new java.awt.Button();
ivjClearButton.setName("ClearButton");
ivjClearButton.setLabel(" Clear ");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
};
return ivjClearButton;
}
/**
代码示例来源:origin: org.jacorb/jacorb
/**
* Return the Button1 property value.
* @return java.awt.Button
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.Button getCloseButton() {
if (ivjCloseButton == null) {
try {
ivjCloseButton = new java.awt.Button();
ivjCloseButton.setName("CloseButton");
ivjCloseButton.setLabel(" Close ");
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
};
return ivjCloseButton;
}
/**
代码示例来源:origin: stackoverflow.com
public void setValues(Button btn,Territory t ){
btn.setLabel(t.units());
if(t.getOwner().toString().equals("Player 1"))
{
btn.setBackground(Color.BLUE);
}
else if(t.getOwner().toString().equals("Player 2"))
{
btn.setBackground(Color.RED);
}
else if (t.getOwner().toString().equals("Player 3"))
{
btn.setBackground(Color.GREEN);
}
else if (t.getOwner().toString().equals("Player 4"))
{
btn.setBackground(Color.YELLOW);
}
}
代码示例来源:origin: FellowTraveler/otapij
public void init() {
this.setBackground (Color.lightGray);
clipboard = getToolkit ().getSystemClipboard ();
cmdCopy.setLabel("Copy source to clipboard");
cmdPaste.setLabel ("Paste to the destination field");
labelSource.setAlignment(Label.RIGHT);
labelSource.setText("Source text");
labelDestination.setAlignment(Label.RIGHT);
labelDestination.setText("Copy to the clipboard");
this.add(labelSource);
this.add(sourceText);
this.add(labelDestination);
this.add(destinationText);
this.add(cmdCopy);
this.add (cmdPaste);
cmdCopy.addActionListener (new cmdCopyActionListener ());
cmdPaste.addActionListener (new cmdPasteActionListener ());
}
代码示例来源:origin: sc.fiji/VIB-lib
void rename(int i) {
NamedPointWorld npw = points.get(i);
GenericDialog gd = new GenericDialog( "Rename Point" );
gd.addStringField( "Rename point to:", npw.getName() );
gd.showDialog();
if( gd.wasCanceled() )
return;
String newName = gd.getNextString();
boolean result = points.renamePointTo( i, newName );
if( result ) {
dialog.markButtons[i].setLabel( newName );
dialog.pack();
} else {
IJ.error("Couldn't rename point: there already is one called \"" + newName + "\"" );
}
}
内容来源于网络,如有侵权,请联系作者删除!