Java Code Examples for javax.swing.JLabel.setVisible()

The following are Jave code examples for showing how to use setVisible() of the javax.swing.JLabel class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: jmt   File: ClassSwitchSectionPanel.java   View Source Code Vote up 6 votes
protected void initComponents() {
	removeAll();
	setLayout(new BorderLayout());

	WarningScrollTable wST = new WarningScrollTable(csTable, WARNING_CLASS);
	setBorder(new TitledBorder(new EtchedBorder(), "CS Strategies"));
	setMinimumSize(new Dimension(180, 100));
	descriptionLabel = new JLabel(DESCRIPTION);
	normalizzationErrorLabel = new JLabel(NORMALIZATION_ERROR);
	normalizzationWarningLabel = new JLabel(NORMALIZATION_WARNING);
	checkRowLessThanOne();
	add(wST, BorderLayout.CENTER);
	add(descriptionLabel, BorderLayout.SOUTH);
	JPanel msgPanel = new JPanel(new BorderLayout());
	msgPanel.add(normalizzationErrorLabel, BorderLayout.NORTH);
	msgPanel.add(normalizzationWarningLabel, BorderLayout.SOUTH);
	add(msgPanel, BorderLayout.NORTH);
	if (descriptionLabel != null) {
		descriptionLabel.setVisible(classData.getClassKeys().size() != 0);
	}
}
 
Example 2
Project: KernelHive   File: InputDataPanel.java   View Source Code Vote up 6 votes
public InputDataPanel(List<String> previouslyUsedURLs) {
	setSize(new Dimension(900, 300));
	setPreferredSize(new Dimension(900, 300));
	setMinimumSize(new Dimension(450, 300));
	setLayout(null);

	JLabel lblInputDataUrl = new JLabel("Input data URL");
	lblInputDataUrl.setBounds(12, 12, 105, 15);
	add(lblInputDataUrl);

	lblUrlIsInvalid = new JLabel("URL is invalid!");
	lblUrlIsInvalid.setVisible(false);
	lblUrlIsInvalid.setBounds(12, 70, 105, 15);
	add(lblUrlIsInvalid);

	btnValidate = new JButton("Validate");
	btnValidate.setBounds(335, 34, 93, 25);
	//add(btnValidate);

	comboBox = new JComboBox();
	comboBox.setEditable(true);
	comboBox.setBounds(12, 34, 311, 24);
	comboBox.setModel(new URLComboBoxModel(previouslyUsedURLs));
	add(comboBox);
}
 
Example 3
Project: alevin-svn2   File: AddConstraintDialog.java   View Source Code Vote up 5 votes
@Override
protected void doComboBoxAction() {
	if (comboBox.getSelectedIndex() > 0) {
		// get the params of the selected resource type.
		paramNames = new ArrayList<String>();
		paramValues = new ArrayList<JTextField>();
		for (final Method m : ((ComboBoxClass) comboBox.getSelectedItem())
				.getClasss().getDeclaredMethods()) {
			// for every setter method get the name of the parameter to set
			// and display it as a label along with a text field for setting
			// the value.
			if (m.isAnnotationPresent(ExchangeParameter.class)
					&& m.getName().startsWith("set")) {
				String name = m.getName().substring(3).toLowerCase();
				paramNames.add(name);
				JLabel paramName = new JLabel(name.replaceFirst("demanded",
						"demanded "));
				paramName.setVisible(true);
				paramsPanel.add(paramName);
				JTextField paramValue = new JTextField(3);
				paramValue.setEditable(true);
				paramValue.setVisible(true);
				paramValues.add(paramValue);
				paramsPanel.add(paramValue);
				paramValue.requestFocus();
			}
		}
	}
}
 
Example 4
Project: Proyecto-DASI   File: VisorCreacionEscenarios1.java   View Source Code Vote up 5 votes
public void eliminarEntidadSeleccionada (){
     JLabel entidadAeliminar=   (JLabel) moverComp.getUltimoComponenteSeleccionado();
//        escenrioSimComp.eliminarEntidad(((JLabel)moverComp.eliminarUltimoCompSeleccionado()).getName());
//     moverComp.deregisterComponent(entidadAeliminar);
     entidadAeliminar.setVisible(false);
       escenarioActualComp.eliminarEntidad(entidadAeliminar.getText());
       listaEntidadesEnEscenario.remove(entidadAeliminar);
        System.out.println( "Se elimina la entidad : "+entidadAeliminar.getText()+ " Coordenadas : X =" + entidadAeliminar.getX() +" , Y = " +entidadAeliminar.getY() );
    actualizarInfoEquipoEnEscenario ();
    }
 
Example 5
Project: incubator-netbeans   File: Util.java   View Source Code Vote up 5 votes
public static void hideLabelAndLabelFor(JComponent component, String lab) {
    JLabel label = findLabel(component, lab);
    if (label != null) {
        label.setVisible(false);
        Component c = label.getLabelFor();
        if (c != null) {
            c.setVisible(false);
        }
    }
}
 
Example 6
Project: incubator-netbeans   File: Util.java   View Source Code Vote up 5 votes
public static void hideLabelAndLabelFor(JComponent component, String lab) {
    JLabel label = findLabel(component, lab);
    if (label != null) {
        label.setVisible(false);
        Component c = label.getLabelFor();
        if (c != null) {
            c.setVisible(false);
        }
    }
}
 
Example 7
Project: incubator-netbeans   File: CloneableEditorInitializer.java   View Source Code Vote up 5 votes
private void addLoadingLabel() {
    editor.setLayout(new BorderLayout());
    loadingLabel = new JLabel(NbBundle.getMessage(CloneableEditor.class, "LBL_EditorLoading")); // NOI18N
    loadingLabel.setOpaque(true);
    loadingLabel.setHorizontalAlignment(SwingConstants.CENTER);
    loadingLabel.setBorder(new EmptyBorder(new Insets(11, 11, 11, 11)));
    loadingLabel.setVisible(false);
    editor.add(loadingLabel, BorderLayout.CENTER);
}
 
Example 8
Project: jmt   File: Sectors3DPanel.java   View Source Code Vote up 5 votes
/**
 * Builds a new Sectors3D Panel to show results of 3-class models
 * @param s3d results vector
 * @param classNames array with class names
 */
public Sectors3DPanel(Vector<Object> s3d, String[] classNames) {
	super(new BorderLayout());
	this.s3d = s3d;
	this.classNames = classNames;
	this.setBackground(BGCOLOR);
	this.setBorder(BorderFactory.createEtchedBorder());

	// Label to show coordinates
	coordLabel = new JLabel();
	coordLabel.setBorder(BorderFactory.createEtchedBorder());
	coordLabel.setVisible(false);
	coordLabel.setOpaque(true);
	// Puts label on south-east corner
	JPanel tmp = new JPanel(new BorderLayout());
	tmp.add(coordLabel, BorderLayout.EAST);
	tmp.setOpaque(false);
	this.add(tmp, BorderLayout.SOUTH);

	// Adds a mouseListener to show graph coordinates
	this.addMouseMotionListener(new MouseMotionAdapter() {
		@Override
		public void mouseMoved(MouseEvent e) {
			if (isShown) {
				String coord = getCoordinates(e.getX(), e.getY());
				if (coord != null) {
					coordLabel.setText(coord);
					coordLabel.setVisible(true);
					Sectors3DPanel.this.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
				} else {
					coordLabel.setText("");
					coordLabel.setVisible(false);
					Sectors3DPanel.this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
				}
			}
		}
	});
}
 
Example 9
Project: hearthstone   File: Animacao.java   View Source Code Vote up 5 votes
/**
 * Criar JLabel padrão para as animações
 *
 * @return JLabel padrão
 */
private JLabel getJLabelDefault() {
    JLabel retorno = new JLabel("", SwingConstants.CENTER) {
        @Override
        public String toString() {
            return card.getToString();
        }
    };
    retorno.setSize(SIZE);
    retorno.setPreferredSize(SIZE);
    retorno.setVisible(false);
    return retorno;
}
 
Example 10
Project: cuttlefish   File: EdgeMetricsPanel.java   View Source Code Vote up 4 votes
/**
 * This method initializes this
 * 
 * @return void
 */
private void initialize() {
	GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
	gridBagConstraints3.gridx = 0;
	gridBagConstraints3.anchor = GridBagConstraints.WEST;
	gridBagConstraints3.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints3.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints3.gridy = 0;
	jLabel = new JLabel();
	jLabel.setText("prefix:");
	jLabel.setVisible(false);
	GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
	gridBagConstraints21.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints21.gridy = 2;
	gridBagConstraints21.weightx = 1.0;
	gridBagConstraints21.gridwidth = 2;
	gridBagConstraints21.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints21.gridx = 0;
	GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
	gridBagConstraints11.gridx = 1;
	gridBagConstraints11.gridy = 1;
	gridBagConstraints11.fill = GridBagConstraints.HORIZONTAL;
	gridBagConstraints11.weightx = 1.0;
	gridBagConstraints11.insets = new Insets(2, 2, 2, 2);
	GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
	gridBagConstraints1.gridx = 0;
	gridBagConstraints1.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints1.fill = GridBagConstraints.BOTH;
	gridBagConstraints1.weightx = 1.0;
	gridBagConstraints1.gridy = 1;
	GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
	gridBagConstraints2.gridx = 0;
	gridBagConstraints2.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints2.fill = GridBagConstraints.BOTH;
	gridBagConstraints2.weightx = 1.0;
	gridBagConstraints2.gridy = 3;
	GridBagConstraints gridBagConstraints = new GridBagConstraints();
	gridBagConstraints.gridx = 1;
	gridBagConstraints.insets = new Insets(2, 2, 2, 2);
	gridBagConstraints.fill = GridBagConstraints.BOTH;
	gridBagConstraints.weightx = 1.0;
	gridBagConstraints.gridy = 3;
	
	this.setSize(287, 230);
	this.setLayout(new GridBagLayout());
	//this.setBorder(BorderFactory.createTitledBorder(null, "export", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
	this.add(getInDegreeDistributionButton(), gridBagConstraints);
	this.add(getOutDegreeNodeButton(), gridBagConstraints1);
	this.add(getEdgeInfoButton(), gridBagConstraints11);
	this.add(getEdgeInfoTextField(), gridBagConstraints21);
	
	this.add(jLabel, gridBagConstraints3);
}
 
Example 11
Project: incubator-netbeans   File: StringEditor.java   View Source Code Vote up 4 votes
@Override
public Component getCustomEditor () {
    if (customEditor == null) {
        JTextArea textArea = new JTextArea();
        textArea.setWrapStyleWord(true);
        textArea.setLineWrap(true);
        textArea.setColumns(60);
        textArea.setRows(8);
        textArea.getDocument().addDocumentListener(this);
        textArea.getAccessibleContext().setAccessibleName(
                NbBundle.getBundle(StringEditor.class).getString("ACSN_StringEditorTextArea")); //NOI18N
        textArea.getAccessibleContext().setAccessibleDescription(
                NbBundle.getBundle(StringEditor.class).getString("ACSD_StringEditorTextArea")); //NOI18N

        JScrollPane scroll = new JScrollPane();
        scroll.setViewportView(textArea);

        JLabel htmlTipLabel = new JLabel(NbBundle.getMessage(StringEditor.class, "StringEditor.htmlTipLabel.text")); // NOI18N

        JPanel panel = new JPanel();
        GroupLayout layout = new GroupLayout(panel);
        layout.setAutoCreateGaps(true);
        panel.setLayout(layout);
        layout.setHorizontalGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup()
                    .addComponent(scroll)
                    .addComponent(htmlTipLabel))
                .addContainerGap());
        layout.setVerticalGroup(layout.createSequentialGroup()
                .addContainerGap().addComponent(scroll).addComponent(htmlTipLabel));

        customEditor = panel;
        textComp = textArea;
        htmlTipLabel.setVisible(htmlText);
    }

    textComp.setEditable(editable);
    setValueToCustomEditor();

    return customEditor;
}
 
Example 12
Project: incubator-netbeans   File: WizardStepProgressSupport.java   View Source Code Vote up 4 votes
private JComponent createProgressComponent() {
    progressLabel = new JLabel(getDisplayName());

    progressBar = super.getProgressComponent();

    stopButton = new JButton(NbBundle.getMessage(WizardStepProgressSupport.class, "BK2022")); // NOI18N
    stopButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            cancel();
        }
    });

    JPanel panel = new JPanel();
    GroupLayout layout = new GroupLayout(panel);

    progressLine = new JPanel();
    progressLine.add(progressBar);
    progressLine.add(Box.createHorizontalStrut(
                            LayoutStyle.getInstance()
                            .getPreferredGap(progressBar,
                                             stopButton,
                                             RELATED,
                                             SwingConstants.EAST,
                                             progressLine)));
    progressLine.add(stopButton);

    progressLine.setLayout(new BoxLayout(progressLine, BoxLayout.X_AXIS));
    progressBar.setAlignmentX(JComponent.CENTER_ALIGNMENT);
    stopButton.setAlignmentX(JComponent.CENTER_ALIGNMENT);

    layout.setHorizontalGroup(
            layout.createParallelGroup(LEADING)
            .addComponent(progressLabel)
            .addComponent(progressLine));
    layout.setVerticalGroup(
            layout.createSequentialGroup()
            .addComponent(progressLabel)
            .addPreferredGap(RELATED)
            .addComponent(progressLine));
    panel.setLayout(layout);

    layout.setHonorsVisibility(false);   //hiding should not affect prefsize

    progressLabel.setVisible(false);
    progressLine.setVisible(false);

    return panel;
}
 
Example 13
Project: AgentWorkbench   File: OntologyTabClassView.java   View Source Code Vote up 4 votes
/**
 * This method initializes this
 */
private void initialize() {
	GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
	gridBagConstraints2.gridx = 2;
	gridBagConstraints2.gridy = 0;
	GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
	gridBagConstraints1.fill = GridBagConstraints.BOTH;
	gridBagConstraints1.insets = new Insets(10, 0, 10, 10);
	gridBagConstraints1.weightx = 1.0;
	GridBagConstraints gridBagConstraints = new GridBagConstraints();
	gridBagConstraints.gridx = 3;
	gridBagConstraints.insets = new Insets(10, 10, 10, 5);
	gridBagConstraints.gridy = 0;
	GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
	gridBagConstraints6.fill = GridBagConstraints.BOTH;
	gridBagConstraints6.gridwidth = 5;
	gridBagConstraints6.gridx = 0;
	gridBagConstraints6.gridy = 1;
	gridBagConstraints6.weightx = 1.0;
	gridBagConstraints6.weighty = 1.0;
	gridBagConstraints6.insets = new Insets(0, 10, 0, 10);
	GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
	gridBagConstraints5.fill = GridBagConstraints.BOTH;
	gridBagConstraints5.gridx = 1;
	gridBagConstraints5.gridy = 0;
	gridBagConstraints5.weightx = 1.0;
	gridBagConstraints5.anchor = GridBagConstraints.CENTER;
	gridBagConstraints5.weighty = 0.0;
	gridBagConstraints5.insets = new Insets(10, 0, 10, 10);
	GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
	gridBagConstraints4.insets = new Insets(10, 10, 10, 5);
	gridBagConstraints4.gridy = 0;
	gridBagConstraints4.anchor = GridBagConstraints.WEST;
	gridBagConstraints4.gridx = 0;

	jLabelDummy = new JLabel();
	jLabelDummy.setText(" ");

	jLabelClassDescCaption = new JLabel();
	jLabelClassDescCaption.setText("Text");
	jLabelClassDescCaption.setVisible(false);

	jLabelClassNameCaption = new JLabel();
	jLabelClassNameCaption.setText("Name:");
	jLabelClassNameCaption.setFont(new Font("Dialog", Font.BOLD, 12));

	this.setSize(392, 238);
	this.setLayout(new GridBagLayout());
	this.add(jLabelClassNameCaption, gridBagConstraints4);
	this.add(getJTextFieldClassName(), gridBagConstraints5);
	this.add(getJScrollPaneClassSlots(), gridBagConstraints6);
	this.add(jLabelClassDescCaption, gridBagConstraints);
	this.add(getJTextFieldClassDescription1(), gridBagConstraints1);
	this.add(jLabelDummy, gridBagConstraints2);
}
 
Example 14
Project: BrainControl   File: MarioError.java   View Source Code Vote up 4 votes
public MarioError(String errorMessage){
	super("ERROR");
	//applicable for multi monitor workstations
	GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
	screenWidth = gd.getDisplayMode().getWidth();
	screenHight = gd.getDisplayMode().getHeight(); 

	this.setLocation((int)((screenWidth - frameWidth)*0.5), (int)(screenHight*0.25));
	this.setSize(frameWidth , (int)(screenHight*0.5)); 
	this.getContentPane().setLayout(new GridBagLayout());
	this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
	
	titleLabel = new JLabel();
	titleLabel.setText("Unfortunately an Error occured");
	titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
	titleLabel.setFont(new Font(titleLabel.getFont().getFontName(), Font.BOLD, 32));
	titleLabel.setForeground(Color.RED);
	titleLabel.setVisible(true);
	LayoutHelper.putGrid(this, titleLabel, 0, 0, 2,1, 1.0, 1.0);
	
	
	errorText = new JTextArea();
	errorText.setText(errorMessage);
	errorText.setWrapStyleWord(true);
    errorText.setLineWrap(true);
    errorText.setEditable(false);
	errorText.setFont(new Font(errorText.getFont().getFontName(), Font.BOLD, 20));
	errorText.setVisible(true);
	

	errorScrollPane = new JScrollPane(errorText);
	errorText.setCaretPosition(0);
	LayoutHelper.putGrid(this, errorScrollPane, 0, 1, 2,1, 1.0, 1.0);
	
	helpButton = new JButton("HELP");
	helpButton.addActionListener(new ActionListener() {
		@Override
		public void actionPerformed(ActionEvent e) {
			if (Desktop.isDesktopSupported()) {
			    try {
			        File myFile = new File("D:/Data/Desktop/Mario SoSe15 Einf�hrung/MarioHelp.pdf");
			        Desktop.getDesktop().open(myFile);
			    } catch (IOException ex) {
			        new MarioError("Could not find help file");
			    }
			}
		}
	});
	LayoutHelper.putGrid(this, helpButton, 0, 2, 2,1, 1.0, 0.2);	
	this.setVisible(true);
}
 
Example 15
Project: saveOrganizer   File: DataPane.java   View Source Code Vote up 4 votes
/**
 * Create the panel.
 */
public DataPane()
{

	JLabel taskLabel = new JLabel("Wir brauchen einige Daten über Sie.");

	JLabel nameLabel = new JLabel("Name");

	nameField = new JTextField();
	nameField.setColumns(10);

	JLabel mailLabel = new JLabel("Mail-Adresse");

	mailField = new JTextField();
	mailField.setColumns(10);

	JButton btnWeiter = new JButton("weiter");
	btnWeiter.setActionCommand("weiter");
	btnWeiter.addActionListener(new ActionHandler());

	JButton btnAbbrechen = new JButton("abbrechen");
	btnAbbrechen.setActionCommand("abbrechen");
	btnAbbrechen.addActionListener(new ActionHandler());

	errorLabel = new JLabel("Error");
	errorLabel.setVisible(false);
	errorLabel.setForeground(Color.RED);
	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout
			.createSequentialGroup()
			.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
					.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(taskLabel))
					.addGroup(groupLayout.createSequentialGroup()
							.addGap(35).addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
									.addComponent(nameLabel).addComponent(mailLabel))
							.addGap(91)
							.addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
									.addComponent(mailField).addComponent(nameField, 144, 144, Short.MAX_VALUE)))
					.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(btnAbbrechen)
							.addPreferredGap(ComponentPlacement.RELATED, 236, Short.MAX_VALUE)
							.addComponent(btnWeiter))
					.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(errorLabel)))
			.addContainerGap()));
	groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
			.createSequentialGroup().addContainerGap().addComponent(taskLabel).addGap(53)
			.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(nameLabel).addComponent(
					nameField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
			.addGap(41)
			.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(mailLabel).addComponent(
					mailField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
			.addPreferredGap(ComponentPlacement.RELATED, 63, Short.MAX_VALUE).addComponent(errorLabel).addGap(26)
			.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(btnWeiter)
					.addComponent(btnAbbrechen))
			.addContainerGap()));
	setLayout(groupLayout);

}
 
Example 16
Project: gate-core   File: ProgressPanel.java   View Source Code Vote up 4 votes
public ProgressPanel() {
  super();

  setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

  progressTotal = new SafeJProgressBar();
  progressTotal.setAlignmentX(CENTER_ALIGNMENT);
  progressTotal.setMaximumSize(new Dimension(250, progressTotal
          .getPreferredSize().height));
  progressTotal.setIndeterminate(true);

  progressSingle = new SafeJProgressBar();
  progressSingle.setAlignmentX(CENTER_ALIGNMENT);
  progressSingle.setMaximumSize(new Dimension(250, progressTotal
          .getPreferredSize().height));
  progressSingle.setIndeterminate(true);
  progressSingle.setVisible(false);
  progressSingle.setMinimum(0);
  progressSingle.setMaximum(100);

  message = new JLabel("");
  message.setIcon(new ProgressIcon(48, 48));
  message.setHorizontalTextPosition(SwingConstants.RIGHT);
  message.setHorizontalAlignment(SwingConstants.CENTER);
  message.setAlignmentX(CENTER_ALIGNMENT);

  dlMsg = new JLabel("Downloading CREOLE Plugin...");
  dlMsg.setIcon(new DownloadIcon(48, 48));
  dlMsg.setHorizontalTextPosition(SwingConstants.RIGHT);
  dlMsg.setHorizontalAlignment(SwingConstants.CENTER);
  dlMsg.setAlignmentX(CENTER_ALIGNMENT);
  dlMsg.setVisible(false);

  add(Box.createVerticalGlue());
  add(message);
  add(Box.createVerticalStrut(5));
  add(progressTotal);
  add(Box.createVerticalStrut(10));
  add(dlMsg);
  add(Box.createVerticalStrut(5));
  add(progressSingle);
  add(Box.createVerticalGlue());

  addComponentListener(this);
}
 
Example 17
Project: saveOrganizer   File: passPane.java   View Source Code Vote up 4 votes
/**
 * Create the panel.
 */
public passPane(String name, String mail)
{
	this.name = name;
	this.mail = mail;

	JLabel label = new JLabel("Wählen Sie ihr Passwort:");

	passwordField = new JPasswordField();
	passwordField.setColumns(15);
	passwordField.setText(standardPassword);

	passwordField_control = new JPasswordField();
	passwordField_control.setColumns(15);
	passwordField_control.setText(standardPassword);

	btnWeiter = new JButton("weiter");
	btnWeiter.setActionCommand("weiter");
	btnWeiter.addActionListener(new ActionHandler());
	btnAbbrechen = new JButton("abbrechen");
	btnAbbrechen.setActionCommand("abbrechen");
	btnAbbrechen.addActionListener(new ActionHandler());
	errorLabel = new JLabel("Fehler!");
	errorLabel.setForeground(Color.RED);
	errorLabel.setVisible(false);

	GroupLayout groupLayout = new GroupLayout(this);
	groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
			.addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(btnAbbrechen)
					.addPreferredGap(ComponentPlacement.RELATED, 236, Short.MAX_VALUE).addComponent(btnWeiter)
					.addContainerGap())
			.addGroup(groupLayout.createSequentialGroup()
					.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
							.addGroup(
									groupLayout.createSequentialGroup().addContainerGap().addComponent(label,
											GroupLayout.DEFAULT_SIZE, 309, Short.MAX_VALUE))
							.addGroup(groupLayout.createSequentialGroup().addGap(152)
									.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
											.addComponent(passwordField_control, GroupLayout.PREFERRED_SIZE,
													GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
											.addComponent(passwordField))))
					.addGap(129))
			.addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap()
					.addComponent(errorLabel).addContainerGap(368, Short.MAX_VALUE)));
	groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(groupLayout
			.createSequentialGroup().addContainerGap().addComponent(label).addGap(38)
			.addComponent(passwordField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE)
			.addGap(50)
			.addComponent(passwordField_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
					GroupLayout.PREFERRED_SIZE)
			.addGap(45).addComponent(errorLabel)
			.addPreferredGap(ComponentPlacement.RELATED, 50, Short.MAX_VALUE).addGroup(groupLayout
					.createParallelGroup(Alignment.BASELINE).addComponent(btnWeiter).addComponent(btnAbbrechen))
			.addContainerGap()));
	setLayout(groupLayout);

}
 
Example 18
Project: saveOrganizer   File: PassAsk.java   View Source Code Vote up 4 votes
/**
 * Create the frame.
 */
public PassAsk()
{
	setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setBounds(100, 100, 450, 300);
	setLocationRelativeTo(null);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);

	JLabel taskLabel = new JLabel("Geben Sie ihr Passwort ein:");

	passwordField = new JPasswordField();
	passwordField.setColumns(15);

	JButton btnWeiter = new JButton("weiter");
	btnWeiter.setActionCommand("weiter");
	btnWeiter.addActionListener(new ActionHandler());

	btnAbbrechen = new JButton("abbrechen");
	btnAbbrechen.setActionCommand("abbrechen");
	btnAbbrechen.addActionListener(new ActionHandler());

	errorLabel = new JLabel("Error");
	errorLabel.setForeground(Color.RED);
	errorLabel.setVisible(false);

	GroupLayout gl_contentPane = new GroupLayout(contentPane);
	gl_contentPane.setHorizontalGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING).addGroup(gl_contentPane
			.createSequentialGroup().addContainerGap()
			.addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(taskLabel).addContainerGap(231,
							Short.MAX_VALUE))
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(btnAbbrechen)
							.addPreferredGap(ComponentPlacement.RELATED, 226, Short.MAX_VALUE)
							.addComponent(btnWeiter).addContainerGap())
					.addGroup(Alignment.TRAILING,
							gl_contentPane.createSequentialGroup()
									.addComponent(passwordField, GroupLayout.PREFERRED_SIZE,
											GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addGap(130))
					.addGroup(gl_contentPane.createSequentialGroup().addComponent(errorLabel).addContainerGap(358,
							Short.MAX_VALUE)))));
	gl_contentPane
			.setVerticalGroup(
					gl_contentPane.createParallelGroup(Alignment.LEADING)
							.addGroup(gl_contentPane.createSequentialGroup().addGap(40).addComponent(taskLabel)
									.addGap(35)
									.addComponent(passwordField, GroupLayout.PREFERRED_SIZE,
											GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
									.addPreferredGap(ComponentPlacement.RELATED, 92, Short.MAX_VALUE)
									.addComponent(errorLabel).addGap(37)
									.addGroup(gl_contentPane.createParallelGroup(Alignment.BASELINE)
											.addComponent(btnWeiter).addComponent(btnAbbrechen))
									.addContainerGap()));
	contentPane.setLayout(gl_contentPane);
}
 
Example 19
Project: javaportfolio   File: BaseDialog.java   View Source Code Vote up 4 votes
/**
 * Set up and show the dialog. The first Component argument determines which
 * frame the dialog depends on; it should be a component in the dialog's
 * controlling frame. The second Component argument should be null if you
 * want the dialog to come up with its left corner in the center of the
 * screen; otherwise, it should be the component on top of which the dialog
 * should appear.
 */

public BaseDialog(Component frameComp, Component locationComp,
		String title, I_TickerManager tickerManager) {
	super(JOptionPane.getFrameForComponent(frameComp), title, true);
	this.frameComp = frameComp;
	dateChooser = new JDateChooser(Calendar.getInstance().getTime());
	dateChooser.setLocale(new Locale("fi", "FI"));

	this.tickerManager = tickerManager;

	// Create and initialize the buttons.
	cancelButton = new JButton(BUTTON_CANCEL);
	cancelButton.addActionListener(this);
	cancelButton.setActionCommand(BUTTON_CANCEL);

	okButton = new JButton(BUTTON_OK);
	okButton.setActionCommand(BUTTON_OK);
	okButton.addActionListener(this);
	getRootPane().setDefaultButton(okButton);
	okButton.setEnabled(false);

	rateField = new JTextField(FIELD_LEN);
	rateField.setVisible(true);
	rateField.setText("1.0000");

	rateFieldLabel = new JLabel("Valuuttakurssi: ");
	rateFieldLabel.setLabelFor(rateField);
	rateFieldLabel.setVisible(true);

	localCurrencyButton = new JRadioButton(localCurrencyString);
	foreignCurrencyButton = new JRadioButton(foreignCurrencyString);
	currencyGroup = new ButtonGroup();

	localCurrencyButton.setActionCommand(localCurrencyString);
	foreignCurrencyButton.setActionCommand(foreignCurrencyString);
	localCurrencyButton.setSelected(true);
	currencyGroup.add(localCurrencyButton);
	currencyGroup.add(foreignCurrencyButton);
	updateRateFieldCcy("EUR", false);
	localCurrencyButton.addActionListener(this);
	foreignCurrencyButton.addActionListener(this);
	foreignCurrencyButton.setEnabled(false);
	
}
 
Example 20
Project: Proyecto-DASI   File: VisorCreacionEscenarios1.java   View Source Code Vote up 4 votes
public JLabel crearIconoRobVict(String tipoEntidad, int coordX, int coordY){
        
        JLabel label = new JLabel();
        int correccionX=-30;
        int correccionY=-93;
//        int correccionX=0;
//        int correccionY=0;
        coordX=coordX+correccionX;
        coordY=coordY+correccionY;
        String rutaImagen;
        String identEntidad;
       if ( tipoEntidad.startsWith("Robot")){
           rutaImagen=directorioTrabajo+rutaIconos+imageniconoRobot;
           numeroRobots= escenarioActualComp.getNumRobots();
           
         
//           intervalNumRobots.setText(""+numeroRobots);
             numeroRobots++;
             identEntidad=tipoEntidad+numeroRobots;
           escenarioActualComp.addRoboLoc(identEntidad, new Point(coordX,coordY));
           intervalNumRobots.setText(""+numeroRobots);
//           label.setText(tipoEntidad+numeroRobots);
           
       }
       else{
        rutaImagen=directorioTrabajo+rutaIconos+imageniconoMujer;
        mumeroVictimas= escenarioActualComp.getNumVictimas();
        mumeroVictimas++;
//         intervalNumVictimas.setText(""+mumeroVictimas);
         identEntidad=tipoEntidad+mumeroVictimas;
         escenarioActualComp.addVictimLoc(identEntidad, new Point(coordX,coordY));
//         mumeroVictimas=escenrioSimComp.getNumVictimas();
         intervalNumVictimas.setText(""+mumeroVictimas);
//         identEntidad=tipoEntidad+mumeroVictimas;
//         label.setText(tipoEntidad+mumeroVictimas);
       }
        
        label.setText(identEntidad);
        label.setBounds(10, 10, 100, 100);
//        label.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
//            @Override
//            public void mouseDragged(java.awt.event.MouseEvent evt) {
//                jLabelMouseDragged(evt);
//            }
//            public void mouseReleased(java.awt.event.MouseEvent evt) {
//                jLabelMouseReleased(evt);
//            }
//        });
        
        this.add(label);
        label.setVisible(true);
        
//        label.setIcon(new ImageIcon("E:\\FicheroRed\\Github\\rosaceSIM\\src\\utilsDiseniaEscenariosRosace\\Robot.png"));
        label.setIcon(new ImageIcon(rutaImagen));
        label.setLocation(coordX, coordY);
        this.listaEntidadesEnEscenario.add(label);
        System.out.println( "Se crea la entidad : "+label.getText()+ " Coordenadas : X =" + coordX +" , Y = " +coordY );
//       tablaEntidadesEnEscenario.put(identEntidad, label);
//       listaEntidadesEnEscenario.add(label);
        
       moverComp.registerComponent(label);
        return label;
    }