Java Code Examples for java.awt.Label#setText()
The following examples show how to use
java.awt.Label#setText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Sage.java From sagetv with Apache License 2.0 | 5 votes |
static void setSplashText(String x) { Label tempL = splashText; if (tempL != null) tempL.setText(x); if (Sage.DBG) System.out.println("Splash: " + x); SageTV.writeOutWatchdogFile(); }
Example 2
Source File: GeneratorPanel.java From algorithms-nutshell-2ed with MIT License | 5 votes |
/** * Initialize the proper real estate for this GUI element. * * Top part shows choice from which you can choose a generator. The default * one (if set) is selected; otherwise the first one added is selected. * There is a scrollable region within which potential parameters for the * generator may exist. * */ private void initialize() { numLabel = new Label(); numLabel.setText("Generate how many:"); numLabel.setLocation(new Point(22, 300)); numLabel.setSize(new Dimension(122, 23)); genLabel = new Label(); genLabel.setText("Execute Generator:"); genLabel.setLocation(new Point(10, 270)); genLabel.setSize(new Dimension(220, 23)); choiceLabel = new Label(); choiceLabel.setText("Selected Generator:"); choiceLabel.setLocation(new Point(10, 25)); choiceLabel.setSize(new Dimension(220, 23)); paramLabel = new Label(); paramLabel.setText("Construct Generator with parameters:"); paramLabel.setLocation(new Point(10, 75)); paramLabel.setSize(new Dimension(220, 24)); this.setPreferredSize(new Dimension(239, 350)); this.setLayout(null); this.setBackground(SystemColor.control); this.add(paramLabel, null); this.add(getCurrentChoice(), null); this.add(choiceLabel, null); this.add(getGenerateButton(), null); this.add(genLabel, null); this.add(numLabel, null); this.add(getNumField(), null); this.add(getParametersPanel(), null); }
Example 3
Source File: PreDefinedBoundingBox.java From SPIM_Registration with GNU General Public License v2.0 | 5 votes |
protected final static void update( final SpimData2 spimData, final Choice choice, final Label label1, final Label label2 ) { final int index = choice.getSelectedIndex(); final BoundingBox bb = spimData.getBoundingBoxes().getBoundingBoxes().get( index ); label1.setText( "Bounding Box size: " + bb.dimension( 0 ) + "x" + bb.dimension( 1 ) + "x" + bb.dimension( 2 ) + " pixels" ); label2.setText( "Bounding Box offset: " + bb.min( 0 ) + "x" + bb.min( 1 ) + "x" + bb.min( 2 ) + " pixels" ); }
Example 4
Source File: InteractivePlotter.java From Scripts with GNU General Public License v3.0 | 5 votes |
private void updatePromptLabel(final int index, final String newLabel, final Color color) { try { synchronized (prompt.getTreeLock()) { final Label label = ((Label) prompt.getComponent(index)); label.setAlignment(Label.RIGHT); label.setText(newLabel); label.setForeground(color); } } catch (final ArrayIndexOutOfBoundsException | ClassCastException ignored) { // Do nothing: index is not valid } }
Example 5
Source File: Merge_Cluster_Jobs.java From SPIM_Registration with GNU General Public License v2.0 | 4 votes |
protected void update( final Label label ) { label.setText( this.message ); label.setForeground( this.color ); }