本文整理了Java中java.awt.Label.<init>()
方法的一些代码示例,展示了Label.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.<init>()
方法的具体详情如下:
包路径:java.awt.Label
类名称:Label
方法名:<init>
暂无
代码示例来源:origin: log4j/log4j
protected void wrapStringOnPanel(String message,
Container container) {
GridBagConstraints c = getDefaultConstraints();
c.gridwidth = GridBagConstraints.REMAINDER;
// Insets() args are top, left, bottom, right
c.insets = new Insets(0, 0, 0, 0);
GridBagLayout gbLayout = (GridBagLayout) container.getLayout();
while (message.length() > 0) {
int newLineIndex = message.indexOf('\n');
String line;
if (newLineIndex >= 0) {
line = message.substring(0, newLineIndex);
message = message.substring(newLineIndex + 1);
} else {
line = message;
message = "";
}
Label label = new Label(line);
label.setFont(DISPLAY_FONT);
gbLayout.setConstraints(label, c);
container.add(label);
}
}
代码示例来源:origin: com.h2database/h2
constraintsLabel.gridy = 0;
Label label = new Label("H2 Console URL:", Label.LEFT);
label.setFont(font);
mainPanel.add(label, constraintsLabel);
代码示例来源:origin: wildfly/wildfly
leave_button.setFont(default_font);
leave_button.addActionListener(this);
mbr_label=new Label("0 mbr(s)");
mbr_label.setFont(default_font);
sub_panel.add("South", clear_button);
代码示例来源:origin: wildfly/wildfly
leave_button.setFont(default_font);
leave_button.addActionListener(this);
mbr_label = new Label("1 mbr(s)");
mbr_label.setFont(default_font);
p.add("South", leave_button);
代码示例来源:origin: camunda/camunda-bpm-platform
protected void wrapStringOnPanel(String message,
Container container) {
GridBagConstraints c = getDefaultConstraints();
c.gridwidth = GridBagConstraints.REMAINDER;
// Insets() args are top, left, bottom, right
c.insets = new Insets(0, 0, 0, 0);
GridBagLayout gbLayout = (GridBagLayout) container.getLayout();
while (message.length() > 0) {
int newLineIndex = message.indexOf('\n');
String line;
if (newLineIndex >= 0) {
line = message.substring(0, newLineIndex);
message = message.substring(newLineIndex + 1);
} else {
line = message;
message = "";
}
Label label = new Label(line);
label.setFont(DISPLAY_FONT);
gbLayout.setConstraints(label, c);
container.add(label);
}
}
代码示例来源:origin: org.apfloat/apfloat-samples
/**
* Initialize the "threads" section GUI elements.
* Elements should be added for the remainder of the width of the <code>container</code>.
*
* @param container The container where the elements are to be added.
* @param constraints The constraints with which the elements are to be added to the <code>container</code>.
*/
protected void initThreads(Container container, GridBagConstraints constraints)
{
constraints.gridwidth = GridBagConstraints.REMAINDER;
container.add(new Label(), constraints);
}
代码示例来源:origin: com.stevesoft.pat/pat
/** Add a right justified line of text to the message. */
public void addRight(String lb) {
v.addElement(new Label(lb,Label.RIGHT));
}
/** This action will dispose of this graphics object and
代码示例来源:origin: net.imagej/ij
private Label makeLabel(String label) {
if (IJ.isMacintosh())
label += " ";
return new Label(label);
}
代码示例来源:origin: org.w3c.jigsaw/jigsaw
/**
* Add a field editor.
* @param title The title for the field.
* @param editor Its editor component.
*/
protected void addField (String title, Component editor) {
Label label = new Label(title, Label.LEFT) ;
gb.setConstraints(label, ct) ;
add(label) ;
gb.setConstraints(editor, cv) ;
add(editor) ;
}
代码示例来源:origin: sc.fiji/VIB-lib
private Label addLabel(String txt) {
constr.insets = new Insets(10, 5, 0, 5);
Label label = new Label(txt);
label.setFont(font);
add(label, constr);
constr.insets = new Insets(0, 5, 0, 5);
return label;
}
代码示例来源:origin: sc.fiji/3D_Viewer
/**
* Helper method to add the header of the PointList as a Label to the panel.
*/
private void addHeader() {
final Label l = new Label(header);
l.setFont(new Font("Verdana", Font.BOLD, 12));
c.gridy = 0;
c.gridwidth = 2;
c.gridx = 0;
add(l, c);
c.gridwidth = 1;
}
代码示例来源:origin: de.fosd.typechef/javabdd_repackaged
public JDDVersion() {
Color bgcolor = new Color(0xE0, 0xE0, 0xE0) ;
setBackground( bgcolor );
setLayout( new BorderLayout() );
add( new Label("Current JDD build# : " + Version.build), BorderLayout.NORTH );
add( new Label("Updated " + Version.date), BorderLayout.SOUTH);
}
}
代码示例来源:origin: sc.fiji/VIB-lib
private Label addLabel(String s, GridBagConstraints c) {
Label label = new Label(s);
label.setFont(font);
this.add(label, c);
return label;
}
}
代码示例来源:origin: mikera/tyrant
private Panel createSourceStatus() {
sourceStatusBar = new Panel(new BorderLayout());
sourceStatusLabel = new Label("Bob", Label.CENTER);
sourceStatusBar.add(sourceStatusLabel, BorderLayout.CENTER);
sourceStatusBar.setVisible(false);
return sourceStatusBar;
}
代码示例来源:origin: org.apfloat/apfloat-samples
@Override
protected void initThreads(Container container, GridBagConstraints constraints)
{
this.threadsLabel = new Label("Threads:");
container.add(this.threadsLabel, constraints);
this.threadsField = new TextField(ApfloatContext.getContext().getProperty(ApfloatContext.NUMBER_OF_PROCESSORS), 5);
constraints.gridwidth = GridBagConstraints.REMAINDER;
container.add(this.threadsField, constraints);
}
代码示例来源:origin: sc.fiji/VIB-lib
private void addHints() {
// larger font to distinguish keys more easily
Font keyFont = new Font("Monospaced", Font.PLAIN, 12);
addLabel("Hints:");
Label label = new Label("Jump to prev/next selection:");
label.setFont(font);
add(label, constr);
label = new Label("\",\"\t/\t\".\"");
label.setFont(keyFont);
add(label, constr);
}
代码示例来源:origin: IanDarwin/javasrc
LabelsPanel() {
super();
setBackground(Color.green);
setLayout(new GridLayout(3,2));
add(new Label("Left Offset:"));
add(new TextField(5));
add(new Label("Rows:"));
add(new TextField(5));
add(new Label("Cols:"));
add(new TextField(5));
}
public String getChoice() {
代码示例来源:origin: IanDarwin/javasrc
PhonesPanel() {
super();
setBackground(Color.red);
setLayout(new FlowLayout());
add(new Label("Tab markers at edge of page?"));
add(new Checkbox());
add(new Label("Each letter starts page?"));
add(new Checkbox());
}
public String getChoice() {
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
public InstanceSavePanel() {
setLayout(new BorderLayout());
arffFile_Tex = new TextField("arffoutput.arff");
add("Center", arffFile_Tex);
count_Lab = new Label("0 instances");
add("East", count_Lab);
// setSize(60,40);
setBackground(Color.lightGray);
}
代码示例来源:origin: org.w3c.jigsaw/jigsaw
private void init() {
setLayout( new BorderLayout());
label = new Label(getString(true));
checkbox = new Checkbox();
checkbox.setState(true);
checkbox.addItemListener(this);
add(checkbox,"West");
add(label,"Center");
size = new Dimension(75,30);
}
内容来源于网络,如有侵权,请联系作者删除!