Java Code Examples for javax.swing.JTextField

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project addis, under directory /application/src/main/java/org/drugis/addis/gui/wizard/.

Source file: AddStudyWizard.java

  32 
vote

@Override protected void addAdditionalFields(PanelBuilder builder,CellConstraints cc,int rows,int idx){
  builder.addLabel("Size: ",cc.xy(7,rows));
  JTextField sizeField=BasicComponentFactory.createFormattedTextField(new PresentationModel<Arm>(d_pm.getList().get(idx)).getModel(Arm.PROPERTY_SIZE),new DefaultFormatter());
  sizeField.setColumns(4);
  builder.add(sizeField,cc.xy(9,rows));
}
 

Example 2

From project Agot-Java, under directory /src/main/java/got/utility/.

Source file: PolygonGrabber.java

  32 
vote

/** 
 * doneCurrentGroup() Does something with respect to check if the name of a territory is valid or not.
 * @throws HeadlessException
 */
private void doneCurrentGroup() throws HeadlessException {
  final JTextField text=new JTextField();
  final Iterator<Entry<String,Point>> centersiter=m_centers.entrySet().iterator();
  guessCountryName(text,centersiter);
  final int option=JOptionPane.showConfirmDialog(this,text);
  if (option == 0) {
    if (!m_centers.keySet().contains(text.getText())) {
      JOptionPane.showMessageDialog(this,"not a valid name");
      m_current=null;
      return;
    }
    m_polygons.put(text.getText(),m_current);
    m_current=null;
  }
 else   if (option > 0) {
    m_current=null;
  }
 else {
    System.out.println("something very invalid");
  }
}
 

Example 3

From project BMach, under directory /src/bmach/ui/gui/components/.

Source file: JIconTextField.java

  32 
vote

public JIconTextField(){
  super();
  this.icon=null;
  Border border=UIManager.getBorder("TextField.border");
  JTextField dummy=new JTextField();
  this.dummyInsets=border.getBorderInsets(dummy);
}
 

Example 4

From project Calendar-Application, under directory /com/toedter/components/.

Source file: JSpinField.java

  32 
vote

public void adjustWidthToMaximumValue(){
  JTextField testTextField=new JTextField(Integer.toString(max));
  int width=testTextField.getPreferredSize().width;
  int height=testTextField.getPreferredSize().height;
  textField.setPreferredSize(new Dimension(width,height));
  textField.revalidate();
}
 

Example 5

From project ceres, under directory /ceres-ui/src/main/java/com/bc/ceres/swing/binding/internal/.

Source file: NumericEditor.java

  32 
vote

@Override public JComponent createEditorComponent(PropertyDescriptor propertyDescriptor,BindingContext bindingContext){
  JTextField textField=new JTextField();
  textField.setHorizontalAlignment(SwingConstants.RIGHT);
  int fontSize=textField.getFont().getSize();
  textField.setFont(new Font("Courier",Font.PLAIN,fontSize));
  ComponentAdapter adapter=new TextComponentAdapter(textField);
  bindingContext.bind(propertyDescriptor.getName(),adapter);
  return textField;
}
 

Example 6

From project codjo-imports, under directory /codjo-imports-gui/src/main/java/net/codjo/imports/gui/wizard/.

Source file: ImportWizardSummaryGui.java

  32 
vote

private static JTextField createField(String name){
  JTextField field=new JTextField();
  field.setEditable(false);
  field.setName(name);
  return field;
}
 

Example 7

From project codjo-segmentation, under directory /codjo-segmentation-gui/src/test/java/net/codjo/segmentation/gui/settings/.

Source file: ClassificationStructureGuiTest.java

  32 
vote

public void test_setClassificationExtensionPanel() throws Exception {
  ClassificationStructureGui structureGui=new ClassificationStructureGui("toto");
  JPanel jPanel=new JPanel();
  JTextField field=new JTextField(10);
  field.setText("My text");
  field.setName("toto2");
  jPanel.add(field);
  structureGui.setClassificationExtensionPanel(jPanel);
  Window window=new Window(structureGui);
  TextBox textBox=window.getTextBox("toto2");
  assertEquals("My text",textBox.getText());
}
 

Example 8

From project freemind, under directory /freemind/accessories/plugins/time/.

Source file: JSpinField.java

  32 
vote

public void adjustWidthToMaximumValue(){
  JTextField testTextField=new JTextField(Integer.toString(max));
  int width=testTextField.getPreferredSize().width;
  int height=testTextField.getPreferredSize().height;
  textField.setPreferredSize(new Dimension(width,height));
  textField.revalidate();
}
 

Example 9

From project ib-ruby, under directory /misc/IBController 2-9-0/src/ibcontroller/.

Source file: Utils.java

  32 
vote

static boolean setTextField(Window window,int fieldNumber,final String value){
  final JTextField tf=findTextField(window,fieldNumber);
  if (tf != null) {
    tf.setText(value);
    return true;
  }
 else {
    return false;
  }
}
 

Example 10

From project imageflow, under directory /src/de/danielsenff/imageflow/imagej/.

Source file: GenericDialog.java

  32 
vote

/** 
 * Returns the contents of the next text field. 
 */
public String getNextString(){
  String theText;
  if (stringField == null)   return "";
  final JTextField tf=(JTextField)(stringField.elementAt(sfIndex));
  theText=tf.getText();
  if (macro) {
    final String label=(String)labels.get((Object)tf);
    theText=Macro.getValue(macroOptions,label,theText);
  }
  if (recorderOn)   recordOption(tf,theText);
  sfIndex++;
  return theText;
}
 

Example 11

From project beam-meris-icol, under directory /src/main/java/org/esa/beam/meris/icol/ui/.

Source file: IcolForm.java

  31 
vote

private JPanel createMerisCloudPanel(){
  JPanel panel=cloudProductSelector.createDefaultPanel();
  panel.setBorder(BorderFactory.createTitledBorder("Cloud Mask"));
  final JTextField textField=new JTextField(30);
  final Binding binding=bc.bind("cloudMaskExpression",textField);
  final JPanel subPanel=new JPanel(new BorderLayout(2,2));
  subPanel.add(new JLabel("Mask expression:"),BorderLayout.NORTH);
  subPanel.add(textField,BorderLayout.CENTER);
  final JButton etcButton=new JButton("...");
  etcButton.addActionListener(new ActionListener(){
    @Override public void actionPerformed(    ActionEvent e){
      ProductExpressionPane expressionPane;
      Product currentProduct=cloudProductSelector.getSelectedProduct();
      expressionPane=ProductExpressionPane.createBooleanExpressionPane(new Product[]{currentProduct},currentProduct,appContext.getPreferences());
      expressionPane.setCode((String)binding.getPropertyValue());
      if (expressionPane.showModalDialog(null,"Expression Editor") == ModalDialog.ID_OK) {
        binding.setPropertyValue(expressionPane.getCode());
      }
    }
  }
);
  cloudProductSelector.addSelectionChangeListener(new AbstractSelectionChangeListener(){
    @Override public void selectionChanged(    SelectionChangeEvent event){
      updateMerisCloudMaskExpressionEditor(textField,etcButton);
    }
  }
);
  updateMerisCloudMaskExpressionEditor(textField,etcButton);
  subPanel.add(etcButton,BorderLayout.EAST);
  panel.add(subPanel);
  return panel;
}
 

Example 12

From project bndtools, under directory /bndtools.bndplugins/src/bndtools/bndplugins/repo/git/.

Source file: GitCredentialsProvider.java

  31 
vote

private static void updateCredentialItems(JComponent[] components){
  for (  JComponent component : components) {
    CredentialItem item=(CredentialItem)component.getClientProperty(CRED_ITEM);
    if (item == null) {
      continue;
    }
    if (item instanceof CredentialItem.Username) {
      JTextField field=(JTextField)component;
      ((CredentialItem.Username)item).setValue(field.getText());
      continue;
    }
    if (item instanceof CredentialItem.Password) {
      JPasswordField field=(JPasswordField)component;
      ((CredentialItem.Password)item).setValue(field.getPassword());
      continue;
    }
    if (item instanceof CredentialItem.StringType) {
      if (item.isValueSecure()) {
        JPasswordField field=(JPasswordField)component;
        ((CredentialItem.StringType)item).setValue(new String(field.getPassword()));
        continue;
      }
      JTextField field=(JTextField)component;
      ((CredentialItem.Username)item).setValue(field.getText());
      continue;
    }
    if (item instanceof CredentialItem.YesNoType) {
      JCheckBox field=(JCheckBox)component;
      ((CredentialItem.YesNoType)item).setValue(field.isSelected());
      continue;
    }
  }
}
 

Example 13

From project Cinch, under directory /example/com/palantir/ptoss/cinch/example/demo/.

Source file: DemoView.java

  31 
vote

private void showUi(){
  JFrame frame=new JFrame("Demo");
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.setLocation(100,100);
  frame.setSize(600,800);
  JPanel controlsPanel=new JPanel();
  controlsPanel.setOpaque(false);
  BoxLayout box=new BoxLayout(controlsPanel,BoxLayout.Y_AXIS);
  controlsPanel.setLayout(box);
  controlsPanel.add(panelOf(new JLabel("Enabling Button:"),demoBooleanCheckBox,demoButton1,demoButton2));
  controlsPanel.add(panelOf(new JLabel("Bind Radio Buttons to boolean:"),trueButton,falseButton));
  controlsPanel.add(new JSeparator());
  controlsPanel.add(panelOf(new JLabel("Bind Radio Buttons to enum:"),fooButton,barButton,bazButton,setToFooButton));
  controlsPanel.add(new JSeparator());
  controlsPanel.add(panelOf(new JLabel("Filtering JList:"),filterText,demoList,changeList,changeSelection,listChangedLabel));
  controlsPanel.add(new JSeparator());
  controlsPanel.add(panelOf(new JLabel("Multiselect JList:"),demoMultiselectList,multiselectContents,selectMulti));
  controlsPanel.add(new JSeparator());
  controlsPanel.add(panelOf(new JLabel("Bind JComboBox:"),comboBox,selItem));
  controlsPanel.add(new JSeparator());
  controlsPanel.add(panelOf(new JLabel("Slider:"),slider,sliderValue,setSlider));
  controlsPanel.add(new JSeparator());
  String text="test\nlabel\ttab";
  JLabel testLabel=new JLabel(text);
  JTextField testField=new JTextField(text);
  controlsPanel.add(panelOf(testLabel,testField));
  controlsPanel.add(panelOf(new JLabel("Custom component:"),pointButton,lineButton,allowDrag,clearButton));
  controlsPanel.add(canvas);
  panel.setLayout(new BorderLayout());
  panel.add(controlsPanel,BorderLayout.NORTH);
  panel.add(canvas,BorderLayout.CENTER);
  frame.setContentPane(panel);
  frame.setVisible(true);
}
 

Example 14

From project codjo-control, under directory /codjo-control-gui/src/main/java/net/codjo/control/gui/plugin/.

Source file: DefaultQuarantineDetailWindow.java

  31 
vote

private void addDeclaredField(DetailDataSource detailDataSource,StructureReader reader,String fieldName,String tabName){
  TableStructure tableBySqlName=reader.getTableBySqlName(guiData.getQuarantine());
  String label=tableBySqlName.getFieldByJava(fieldName).getLabel();
  String entityName=tableBySqlName.getJavaName();
  addField(detailDataSource,fieldName,getTranslationIfStartsWithPrefix(entityName,label),new JTextField(),tabName);
}
 

Example 15

From project codjo-data-process, under directory /codjo-data-process-gui/src/main/java/net/codjo/dataprocess/gui/tables/.

Source file: UserDetailWindow.java

  31 
vote

@Override protected void declareFields() throws RequestException {
  addFieldToPage("Param?rage","userName","Identifiant de l'utilisateur",new JTextField());
  textAreaXml=new JTextArea();
  textAreaXml.setRows(14);
  addField("userParam","Param?res de l'utilisateur",textAreaXml);
  buildGui();
}
 

Example 16

From project codjo-standalone-common, under directory /src/main/java/net/codjo/utils/sql/.

Source file: DefaultDetailWindow.java

  31 
vote

/** 
 * Remplit la HashMap des composants avec le nom du champ comme cl et le composant comme valeur
 * @param conMan Description of Parameter
 * @exception SQLException Description of Exception
 */
private void initComponentList(ConnectionManager conMan) throws SQLException {
  FieldLabelComparator comparator=new FieldLabelComparator(conMan,tableToDisplay.getDBTableName());
  componentList=new TreeMap(comparator);
  Map columnList=tableToDisplay.getAllColumns();
  Iterator iter=columnList.keySet().iterator();
  while (iter.hasNext()) {
    String fieldName=(String)iter.next();
    Integer sqlType=(Integer)columnList.get(fieldName);
    if (sqlType.intValue() == Types.BIT) {
      JCheckBox cbx=new JCheckBox();
      cbx.setText("(modifi)");
      componentList.put(fieldName,cbx);
    }
 else {
      JTextField txf=new JTextField();
      componentList.put(fieldName,txf);
    }
  }
  if (tableToDisplay.getPkNames().size() == 1) {
    componentList.remove(tableToDisplay.getPkNames().get(0));
  }
}
 

Example 17

From project cp-common-utils, under directory /src/com/clarkparsia/common/net/.

Source file: VisualAuthenticator.java

  31 
vote

/** 
 * @inheritDoc
 */
@Override protected PasswordAuthentication getPasswordAuthentication(){
  JTextField aUser=new JTextField();
  JTextField aPassword=new JPasswordField();
  JLabel aUserLabel=new JLabel("User");
  aUserLabel.setLabelFor(aUserLabel);
  JLabel aPasswordLabel=new JLabel("Password");
  aPasswordLabel.setLabelFor(aPassword);
  JPanel aPanel=new JPanel(new GridLayout(2,2));
  aPanel.add(aUserLabel);
  aPanel.add(aUser);
  aPanel.add(aPasswordLabel);
  aPanel.add(aPassword);
  int aOption=JOptionPane.showConfirmDialog(null,new Object[]{"Host: " + getRequestingHost(),"Realm: " + getRequestingPrompt(),aPanel},"Authorization Required",JOptionPane.OK_CANCEL_OPTION,JOptionPane.PLAIN_MESSAGE);
  if (aOption == JOptionPane.OK_OPTION) {
    return new PasswordAuthentication(aUser.getText(),aPassword.getText().toCharArray());
  }
 else {
    return null;
  }
}
 

Example 18

From project drools-planner, under directory /drools-planner-examples/src/main/java/org/drools/planner/examples/cloudbalancing/swingui/.

Source file: CloudComputerPanel.java

  31 
vote

private JPanel createAssignmentsPanel(){
  JPanel assignmentsPanel=new JPanel(new GridLayout(0,5));
  int colorIndex=0;
  for (  CloudProcess process : processList) {
    JLabel processLabel=new JLabel(process.getLabel());
    processLabel.setForeground(TangoColors.SEQUENCE_1[colorIndex]);
    assignmentsPanel.add(processLabel);
    JTextField cpuPowerField=new JTextField(process.getRequiredCpuPower() + " GHz");
    cpuPowerField.setEditable(false);
    assignmentsPanel.add(cpuPowerField);
    JTextField memoryField=new JTextField(process.getRequiredMemory() + " GB");
    memoryField.setEditable(false);
    assignmentsPanel.add(memoryField);
    JTextField networkBandwidthField=new JTextField(process.getRequiredNetworkBandwidth() + " GB");
    networkBandwidthField.setEditable(false);
    assignmentsPanel.add(networkBandwidthField);
    assignmentsPanel.add(new JLabel(""));
    colorIndex=(colorIndex + 1) % TangoColors.SEQUENCE_1.length;
  }
  return assignmentsPanel;
}
 

Example 19

From project droolsjbpm-integration, under directory /droolsjbpm-integration-examples/src/main/java/org/drools/examples/broker/ui/.

Source file: ScrollingBanner.java

  31 
vote

public ScrollingBanner(){
  super();
  ticks=new ConcurrentLinkedQueue<StockTick>();
  setBackground(Color.BLACK);
  setForeground(Color.GREEN);
  setFont(new JTextField().getFont().deriveFont(Font.BOLD));
  setPreferredSize(new Dimension(500,20));
}
 

Example 20

From project eclim, under directory /org.eclim.installer/java/org/eclim/installer/step/.

Source file: VimStep.java

  31 
vote

/** 
 * {@inheritDoc}
 * @see org.formic.wizard.step.GuiStep#init()
 */
public Component init(){
  GuiForm form=createForm();
  String files=fieldName("files");
  fileChooser=new FileChooser(JFileChooser.DIRECTORIES_ONLY);
  fileChooser.getFileChooser().setFileHidingEnabled(false);
  fileChooser.getFileChooser().addChoosableFileFilter(new FileFilter(){
    public boolean accept(    java.io.File f){
      String path=f.getAbsolutePath();
      return f.isDirectory() && (path.matches(".*/\\.vim(/.*|$)") || !path.matches(".*/\\..*"));
    }
    public String getDescription(){
      return null;
    }
  }
);
  String skip=fieldName("skip");
  skipCheckBox=new JCheckBox(Installer.getString(skip));
  skipCheckBox.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      boolean selected=((JCheckBox)e.getSource()).isSelected();
      JTextField fileField=fileChooser.getTextField();
      fileField.setEnabled(!selected);
      fileChooser.getButton().setEnabled(!selected);
      if (dirList != null) {
        dirList.setEnabled(!selected);
      }
      Validator validator=(Validator)fileField.getClientProperty("validator");
      setValid(selected || validator.isValid(fileField.getText()));
    }
  }
);
  panel=new JPanel(new MigLayout("wrap 2","[fill]","[] [] [] [fill, grow]"));
  panel.add(form.createMessagePanel(),"span");
  panel.add(new JLabel(Installer.getString(files)),"split");
  panel.add(fileChooser,"skip");
  panel.add(skipCheckBox,"span");
  form.bind(files,fileChooser.getTextField(),new ValidatorBuilder().required().isDirectory().fileExists().isWritable().validator());
  return panel;
}
 

Example 21

From project empire-db, under directory /empire-db-examples/empire-db-example-cxf/src/main/java/org/apache/empire/samples/cxf/wssample/client/.

Source file: ClientGUI.java

  31 
vote

/** 
 * This method initializes _txtName
 * @return javax.swing.JTextField
 */
private JTextField get_txtName(){
  if (_txtName == null) {
    _txtName=new JTextField();
    _txtName.setLocation(new Point(120,225));
    _txtName.setPreferredSize(new Dimension(150,20));
    _txtName.setSize(new Dimension(150,20));
  }
  return _txtName;
}
 

Example 22

From project encog-java-workbench, under directory /src/main/java/org/encog/workbench/dialogs/common/.

Source file: FileField.java

  31 
vote

@Override public int createField(JPanel panel,int x,int y,int width){
  this.button=new JButton("Browse...");
  button.setSize(button.getPreferredSize());
  int buttonWidth=button.getWidth();
  button.setLocation(x + width - buttonWidth,y);
  JTextField field=new JTextField();
  field.setLocation(x,y);
  field.setSize(field.getPreferredSize());
  field.setSize(width - buttonWidth - 8,field.getHeight());
  this.setField(field);
  JLabel label=createLabel();
  label.setLocation(label.getX(),y);
  panel.add(label);
  panel.add(field);
  panel.add(button);
  button.addActionListener(this);
  return y + button.getHeight() + 2;
}
 

Example 23

From project formic, under directory /src/samples/src/java/org/sample/gui/.

Source file: TestStep.java

  31 
vote

public Component init(){
  JPanel panel=new JPanel();
  JTextField nameField=new JTextField();
  JTextField locationField=new JTextField();
  GuiForm form=createForm();
  String name=fieldName("name");
  String location=fieldName("location");
  panel.setLayout(new MigLayout("wrap 2"));
  panel.add(form.createMessagePanel(),"span");
  panel.add(new JLabel(Installer.getString(name)));
  panel.add(nameField,"width 150!");
  panel.add(new JLabel(Installer.getString(location)));
  panel.add(locationField,"width 150!");
  form.bind(name,nameField,new ValidatorBuilder().required().validator());
  form.bind(location,locationField);
  return panel;
}
 

Example 24

From project gitblit, under directory /src/com/gitblit/client/.

Source file: EditRepositoryDialog.java

  31 
vote

public void setCustomFields(RepositoryModel repository,Map<String,String> customFields){
  customFieldsPanel.removeAll();
  customTextfields=new ArrayList<JTextField>();
  final Insets insets=new Insets(5,5,5,5);
  JPanel fields=new JPanel(new GridLayout(0,1,0,5)){
    private static final long serialVersionUID=1L;
    @Override public Insets getInsets(){
      return insets;
    }
  }
;
  for (  Map.Entry<String,String> entry : customFields.entrySet()) {
    String field=entry.getKey();
    String value="";
    if (repository.customFields != null && repository.customFields.containsKey(field)) {
      value=repository.customFields.get(field);
    }
    JTextField textField=new JTextField(value);
    textField.setName(field);
    textField.setPreferredSize(new Dimension(450,26));
    fields.add(newFieldPanel(entry.getValue(),250,textField));
    customTextfields.add(textField);
  }
  JScrollPane jsp=new JScrollPane(fields);
  jsp.getVerticalScrollBar().setBlockIncrement(100);
  jsp.getVerticalScrollBar().setUnitIncrement(100);
  jsp.setViewportBorder(null);
  customFieldsPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
  customFieldsPanel.add(jsp);
}
 

Example 25

From project glg2d, under directory /src/test/java/glg2d/.

Source file: UIDemo.java

  31 
vote

JComponent createInputComponent(){
  JPanel panel=new JPanel();
  JComboBox box=new JComboBox(new String[]{"alpha","bravo","charlie","delta","echo","foxtrot","golf","hotel"});
  panel.add(box);
  JSpinner spinner=new JSpinner(new SpinnerNumberModel());
  panel.add(spinner);
  spinner=new JSpinner(new SpinnerDateModel());
  panel.add(spinner);
  JTextField field=new JTextField();
  field.setText("lorem ipsum...");
  field.setColumns(10);
  panel.add(field);
  JTextArea area=new JTextArea();
  area.setText("lorem ipsum... lorem ipsum lorem ipsum...\n lorem ipsum...\n lorem ipsum...");
  area.setColumns(10);
  area.setRows(3);
  panel.add(new JScrollPane(area));
  JPanel p=new JPanel();
  p.setPreferredSize(new Dimension(100,50));
  panel.add(new JScrollPane(p,ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS));
  JSlider slider=new JSlider();
  slider.setPaintTicks(true);
  slider.setPaintLabels(true);
  panel.add(slider);
  return panel;
}
 

Example 26

From project harmony, under directory /harmony.ui.topologygui/src/main/java/org/opennaas/ui/topology/domainViews/.

Source file: DomainPanel.java

  31 
vote

/** 
 * This method initializes domDescField.
 * @return javax.swing.JTextField.
 */
JTextField getDomDescField(){
  if (this.domDescField == null) {
    this.domDescField=new JTextField();
    this.domDescField.setBounds(140,126,420,21);
  }
  return this.domDescField;
}
 

Example 27

From project Hotel-Management_MINF10-HCM, under directory /HotelManagement/src/main/java/core/datechooser/.

Source file: JCalTestEclipse.java

  31 
vote

private JTextField getDayTextField(){
  if (dayTextField == null) {
    dayTextField=new JTextField();
    dayTextField.setBounds(new Rectangle(135,150,226,31));
    dayTextField.setForeground(Color.blue);
    dayTextField.setFont(new Font("Dialog",Font.PLAIN,14));
  }
  return dayTextField;
}
 

Example 28

From project hudsontrayapp-plugin, under directory /client-common/src/main/java/org/hudson/trayapp/gui/.

Source file: ConfigurationPanel.java

  31 
vote

/** 
 * This method initializes serverNameField	
 * @return javax.swing.JTextField	
 */
private JTextField getServerNameField(){
  if (serverNameField == null) {
    serverNameField=new JTextField();
    serverNameField.setBounds(new Rectangle(108,8,181,20));
    serverNameField.setEnabled(false);
  }
  return serverNameField;
}
 

Example 29

From project isohealth, under directory /Oauth/java/jmeter/jmeter/src/main/java/org/apache/jmeter/protocol/oauth/control/gui/.

Source file: OAuthConfigGui.java

  31 
vote

/** 
 * Consumer key panel contains Consumer key Use Auth Header? Encode?
 * @return
 */
protected JPanel getConsumerKeyPanel(){
  key=new JTextField(15);
  key.setName(OAuthSampler.KEY);
  JLabel keyLabel=new JLabel(OAuthSamplerGui.getResString("oauth_consumer_key"));
  keyLabel.setLabelFor(key);
  useAuthHeader=new JCheckBox(OAuthSamplerGui.getResString("oauth_use_auth_header"));
  useAuthHeader.setName(OAuthSampler.USE_AUTH_HEADER);
  useAuthHeader.setSelected(false);
  JPanel panel=new JPanel(new GridBagLayout());
  panel.add(keyLabel,fixedConstraints);
  panel.add(key,stretchyConstraints);
  panel.add(useAuthHeader,fixedConstraints);
  return panel;
}
 

Example 30

From project jchempaint, under directory /src/main/org/openscience/jchempaint/dialog/editor/.

Source file: AtomEditor.java

  31 
vote

private void constructPanel(){
  symbolField=new JTextField(4);
  symbolField.getDocument().addDocumentListener(new MyDocumentListener(this));
  addField(GT._("Symbol"),symbolField,this);
  hCountField=new JSpinner(new SpinnerNumberModel());
  addField(GT._("H Count"),hCountField,this);
  formalChargeField=new JSpinner(new SpinnerNumberModel());
  addField(GT._("Formal Charge"),formalChargeField,this);
  isotopeField=new JSpinner(new SpinnerNumberModel());
  addField(GT._("Isotope number"),isotopeField,this);
  commentField=new JTextField(16);
  addField(GT._("Comment"),commentField,this);
}
 

Example 31

From project JDave, under directory /jdave-examples/src/java/jdave/examples/swing/.

Source file: AlbumPanel.java

  31 
vote

public AlbumPanel(final AlbumPresentationModel presentationModel){
  this.presentationModel=presentationModel;
  add(new JLabel("Album"));
  JTextField textField=new JTextField(){
    @Override public void setText(    String t){
      getAlbum().setName(t);
    }
    @Override public String getText(){
      return getAlbum().getName();
    }
  }
;
  textField.setPreferredSize(new Dimension(80,20));
  add(textField);
  add(new Button("Save"){
    @Override protected void onClick(    ActionEvent event){
      presentationModel.save();
    }
  }
);
}
 

Example 32

From project beanmill_1, under directory /src/main/java/com/traxel/lumbermill/event/.

Source file: EventListenerStatus.java

  30 
vote

/** 
 * Creates a new EventListenerStatus object.
 * @param listener  DOCUMENT ME!
 */
public EventListenerStatus(final EventListener listener){
  setLayout(new BoxLayout(this,BoxLayout.X_AXIS));
  setBorder(BorderFactory.createEmptyBorder(4,4,4,4));
  this.listener=listener;
  txtStatus=new JTextField(10);
  txtType=new JTextField(5);
  txtHost=new JTextField(10);
  txtPort=new JTextField(5);
  lblStatus=new JLabel("Listener Status: ",JLabel.TRAILING);
  lblType=new JLabel("  Type: ",JLabel.TRAILING);
  lblHost=new JLabel("  Host: ",JLabel.TRAILING);
  lblPort=new JLabel("  Port: ",JLabel.TRAILING);
  lblStatus.setLabelFor(txtStatus);
  lblType.setLabelFor(txtType);
  lblHost.setLabelFor(txtHost);
  lblPort.setLabelFor(txtPort);
  add(lblStatus);
  add(txtStatus);
  add(lblType);
  add(txtType);
  add(lblHost);
  add(txtHost);
  add(lblPort);
  add(txtPort);
  txtStatus.setEditable(false);
  txtType.setEditable(false);
  txtHost.setEditable(false);
  txtPort.setEditable(false);
  if (listener != null) {
    txtStatus.setText(listener.getStatus());
    txtType.setText(listener.getType());
    txtHost.setText(listener.getHost());
    txtPort.setText(listener.getPortString());
    listener.addPropertyListener(this);
  }
}
 

Example 33

From project CBCJVM, under directory /eclipse/CBC/src/cbc/helpers/.

Source file: Ssh.java

  30 
vote

public String[] promptKeyboardInteractive(String destination,String name,String instruction,String[] prompt,boolean[] echo){
  panel=new JPanel();
  panel.setLayout(new GridBagLayout());
  gbc.weightx=1.0;
  gbc.gridwidth=GridBagConstraints.REMAINDER;
  gbc.gridx=0;
  panel.add(new JLabel(instruction),gbc);
  gbc.gridy++;
  gbc.gridwidth=GridBagConstraints.RELATIVE;
  JTextField[] texts=new JTextField[prompt.length];
  for (int i=0; i < prompt.length; i++) {
    gbc.fill=GridBagConstraints.NONE;
    gbc.gridx=0;
    gbc.weightx=1;
    panel.add(new JLabel(prompt[i]),gbc);
    gbc.gridx=1;
    gbc.fill=GridBagConstraints.HORIZONTAL;
    gbc.weighty=1;
    if (echo[i]) {
      texts[i]=new JTextField(20);
    }
 else {
      texts[i]=new JPasswordField(20);
    }
    panel.add(texts[i],gbc);
    gbc.gridy++;
  }
  if (JOptionPane.showConfirmDialog(null,panel,destination + ": " + name,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) {
    String[] response=new String[prompt.length];
    for (int i=0; i < prompt.length; i++) {
      response[i]=texts[i].getText();
    }
    return response;
  }
 else {
    return null;
  }
}
 

Example 34

From project Clotho-Core, under directory /ClothoApps/ConnectionConfigTool/src/org/clothocad/tool/connectconfigtool/.

Source file: blueTextField.java

  30 
vote

public blueTextField(String fieldname,String initialvalue){
  fieldName=fieldname;
  oldValue=initialvalue;
  setLayout(new BorderLayout());
  setMaximumSize(new Dimension(textfieldwidth + labelwidth,2 * textsize + 2));
  setPreferredSize(new Dimension(textfieldwidth + labelwidth,2 * textsize + 2));
  setOpaque(false);
  label=new JLabel(fieldName);
  label.setForeground(Color.WHITE);
  label.setFont(new java.awt.Font("Arial",Font.BOLD,textsize));
  label.setPreferredSize(new Dimension(labelwidth,2 * textsize));
  add(label,BorderLayout.WEST);
  textField=new JTextField();
  textField.setBackground(navyblue);
  textField.setFont(new java.awt.Font("Arial",Font.PLAIN,textsize));
  textField.setForeground(Color.WHITE);
  textField.setBorder(null);
  textField.setText(initialvalue);
  textField.addFocusListener(this);
  textField.setPreferredSize(new Dimension(textfieldwidth,2 * textsize));
  add(textField,BorderLayout.EAST);
}
 

Example 35

From project collaborative-editor, under directory /mpedit/gui/.

Source file: CServerDialog.java

  30 
vote

protected void init(){
  super.init();
  JPanel mainPanel=new JPanel(new GridLayout(4,4));
  mainPanel.add(new JLabel("Port:"));
  m_field_port=new JTextField(4);
  m_field_port.setText("2305");
  mainPanel.add(m_field_port);
  mainPanel.add(new JLabel("Username:"));
  m_field_nickname=new JTextField(15);
  mainPanel.add(m_field_nickname);
  mainPanel.add(new JLabel("Password:"));
  m_field_password=new JTextField(15);
  mainPanel.add(m_field_password);
  getContentPane().add(mainPanel,BorderLayout.CENTER);
  this.setSize(400,150);
}
 

Example 36

From project dawn-common, under directory /org.dawb.hdf5/src/ncsa/hdf/view/.

Source file: DefaultTextView.java

  30 
vote

public TextAreaEditor(KeyListener keyListener){
  super(new JTextField());
  final JTextArea textArea=new JTextArea();
  textArea.addKeyListener(keyListener);
  textArea.setWrapStyleWord(true);
  textArea.setLineWrap(true);
  JScrollPane scrollPane=new JScrollPane(textArea);
  scrollPane.setBorder(null);
  editorComponent=scrollPane;
  delegate=new DefaultCellEditor.EditorDelegate(){
    private static final long serialVersionUID=7662356579385373160L;
    @Override public void setValue(    Object value){
      textArea.setText((value != null) ? value.toString() : "");
    }
    @Override public Object getCellEditorValue(){
      return textArea.getText();
    }
  }
;
}
 

Example 37

From project dawn-isencia, under directory /com.isencia.passerelle.commons/src/main/java/com/isencia/util/swing/components/.

Source file: JSpinField.java

  30 
vote

/** 
 * Default JSpinField constructor.
 */
public JSpinField(){
  super();
  min=0;
  max=100;
  value=0;
  darkGreen=new Color(0,150,0);
  setLayout(new BorderLayout());
  textField=new JTextField(Integer.toString(value)){
    public boolean isFocusTraversable(){
      return false;
    }
  }
;
  textField.addCaretListener(this);
  textField.addActionListener(this);
  add(textField,BorderLayout.CENTER);
  scrollBar=new JScrollBar(Adjustable.VERTICAL,0,0,0,100){
    public boolean isFocusTraversable(){
      return false;
    }
  }
;
  scrollBar.setPreferredSize(new Dimension(scrollBar.getPreferredSize().width,textField.getPreferredSize().height));
  scrollBar.setMinimum(min);
  scrollBar.setMaximum(max);
  scrollBar.setValue(max + min - value);
  scrollBar.setVisibleAmount(0);
  scrollBar.addAdjustmentListener(this);
  add(scrollBar,BorderLayout.EAST);
}
 

Example 38

From project e4-rendering, under directory /com.toedter.e4.demo.contacts.swing/src/com/toedter/e4/demo/contacts/swing/views/.

Source file: DetailsView.java

  30 
vote

@Inject public DetailsView(JPanel parent){
  FormLayout layout=new FormLayout("right:max(50dlu;p), 4dlu, pref:grow, 3dlu, 40dlu","p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 4dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 4dlu, p, 1dlu, p, 1dlu, p, 4dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p, 1dlu, p");
  builder=new DefaultFormBuilder(layout);
  builder.setDefaultDialogBorder();
  CellConstraints cc=new CellConstraints();
  builder.addSeparator("General",cc.xyw(1,1,5));
  builder.addLabel("Title:",cc.xy(1,3));
  builder.add(titleField=new JTextField(),cc.xy(3,3));
  builder.addLabel("Name:",cc.xy(1,5));
  builder.add(nameField=new JTextField(),cc.xy(3,5));
  builder.addLabel("Company:",cc.xy(1,7));
  builder.add(companyField=new JTextField(),cc.xy(3,7));
  builder.addLabel("Job Title:",cc.xy(1,9));
  builder.add(jobTitleField=new JTextField(),cc.xyw(3,9,3));
  builder.add(imageLabel=new JLabel(),cc.xywh(5,3,1,5));
  builder.addLabel("Note:",cc.xy(1,11));
  builder.add(noteField=new JTextField(),cc.xyw(3,11,3));
  builder.addSeparator("Business Address",cc.xyw(1,13,5));
  builder.addLabel("Street:",cc.xy(1,15));
  builder.add(streetField=new JTextField(),cc.xyw(3,15,3));
  builder.addLabel("City:",cc.xy(1,17));
  builder.add(cityField=new JTextField(),cc.xyw(3,17,3));
  builder.addLabel("Zip:",cc.xy(1,19));
  builder.add(zipField=new JTextField(),cc.xyw(3,19,3));
  builder.addLabel("Country:",cc.xy(1,21));
  builder.add(countryField=new JTextField(),cc.xyw(3,21,3));
  builder.addSeparator("Business Phones",cc.xyw(1,23,5));
  builder.addLabel("Phone:",cc.xy(1,25));
  builder.add(phoneField=new JTextField(),cc.xyw(3,25,3));
  builder.addLabel("Mobile:",cc.xy(1,27));
  builder.add(mobileField=new JTextField(),cc.xyw(3,27,3));
  builder.addSeparator("Business Internet",cc.xyw(1,29,5));
  builder.addLabel("E-Mail:",cc.xy(1,31));
  builder.add(emailField=new JTextField(),cc.xyw(3,31,3));
  builder.addLabel("Web Site:",cc.xy(1,33));
  builder.add(webSiteField=new JTextField(),cc.xyw(3,33,3));
  JPanel panel=builder.getPanel();
  parent.add(panel,BorderLayout.CENTER);
}
 

Example 39

From project encog-java-examples, under directory /src/main/java/org/encog/examples/gui/elementary/.

Source file: ElementaryExample.java

  30 
vote

public ElementaryExample(){
  setSize(500,500);
  setTitle("Elementary CA");
  Container c=getContentPane();
  c.setLayout(new BorderLayout());
  JPanel buttonPanel=new JPanel();
  buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
  c.add(buttonPanel,BorderLayout.NORTH);
  c.add(this.status=new JLabel(),BorderLayout.SOUTH);
  buttonPanel.add(new JLabel("Rule:"));
  buttonPanel.add(this.ruleText=new JTextField("110"));
  buttonPanel.add(new JLabel("Size:"));
  buttonPanel.add(this.sizeText=new JTextField("500"));
  buttonPanel.add(generateButton=new JButton("Generate"));
  this.worldArea=new DisplayPanel();
  this.scroll=new JScrollPane(this.worldArea);
  c.add(this.scroll,BorderLayout.CENTER);
  generateButton.addActionListener(this);
  String[] test={"1x","2x","3x","5x","10x"};
  this.zoomCombo=new JComboBox(test);
  buttonPanel.add(new JLabel("Zoom:"));
  buttonPanel.add(zoomCombo);
  zoomCombo.addItemListener(this);
  this.addWindowListener(this);
}
 

Example 40

From project flyingsaucer, under directory /flying-saucer-core/src/main/java/org/xhtmlrenderer/simple/extend/form/.

Source file: FileField.java

  30 
vote

public JComponent create(){
  JPanel panel=new JPanel(new GridBagLayout());
  panel.setOpaque(false);
  _pathTextField=new JTextField();
  _pathTextField.setColumns(15);
  _browseButton=new JButton("Browse...");
  _browseButton.addActionListener(this);
  GridBagConstraints pathConstraints=new GridBagConstraints();
  pathConstraints.fill=GridBagConstraints.HORIZONTAL;
  pathConstraints.gridx=0;
  pathConstraints.gridy=0;
  pathConstraints.weightx=1.0;
  pathConstraints.anchor=GridBagConstraints.EAST;
  pathConstraints.insets=new Insets(0,0,0,0);
  panel.add(_pathTextField,pathConstraints);
  GridBagConstraints browseConstraints=new GridBagConstraints();
  browseConstraints.fill=GridBagConstraints.HORIZONTAL;
  browseConstraints.gridx=1;
  browseConstraints.gridy=0;
  browseConstraints.weightx=0.0;
  browseConstraints.anchor=GridBagConstraints.EAST;
  browseConstraints.insets=new Insets(0,5,0,0);
  panel.add(_browseButton,browseConstraints);
  return panel;
}
 

Example 41

From project groovejaar, under directory /src/groovejaar/.

Source file: Login.java

  30 
vote

/** 
 * Create the dialog.
 */
public Login(){
  this.setIconImage(new ImageUtil().getLogo());
  setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
  setBounds(100,100,278,218);
  contentPanel.setBorder(new EmptyBorder(5,5,5,5));
{
    textField=new JTextField();
    textField.setColumns(10);
  }
  getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.X_AXIS));
  passwordField=new JPasswordField();
  JLabel lblUsername=new JLabel("Username");
  JLabel lblPassword=new JLabel("Password");
  contentPanel.setLayout(new FormLayout(new ColumnSpec[]{ColumnSpec.decode("252px")},new RowSpec[]{FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("14px"),FormFactory.UNRELATED_GAP_ROWSPEC,RowSpec.decode("20px"),FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("14px"),FormFactory.PARAGRAPH_GAP_ROWSPEC,RowSpec.decode("33px"),FormFactory.RELATED_GAP_ROWSPEC,FormFactory.DEFAULT_ROWSPEC}));
  contentPanel.add(textField,"1, 4, fill, top");
  contentPanel.add(lblUsername,"1, 2, center, top");
  contentPanel.add(lblPassword,"1, 6, center, top");
  contentPanel.add(passwordField,"1, 8, fill, top");
  getContentPane().add(contentPanel);
  chckbxLogin=new JCheckBox("Auto Login");
  contentPanel.add(chckbxLogin,"1, 10");
}
 

Example 42

From project gs-tool, under directory /src/org/graphstream/tool/gui/.

Source file: PathSelector.java

  30 
vote

protected void init(JComponent... l){
  setLayout(new GridBagLayout());
  available=0;
  loaded=0;
  GridBagConstraints c=new GridBagConstraints();
  path=new JTextField(30);
  find=createIconButton(IconButton.Type.FIND,28,null,new ChoosePathAction(this));
  path.setForeground(Resources.getColor(Resources.ColorType.COMPONENT_TEXT));
  path.setBorder(null);
  path.setOpaque(false);
  path.setFont(Resources.getRegularFont(14.0f));
  path.setCaretColor(Resources.getColor(Resources.ColorType.COMPONENT_TEXT));
  if (l != null) {
    labelWidth=0;
    for (int i=0; i < l.length; i++)     labelWidth+=l[i].getPreferredSize().width;
    labelWidth=Math.max(60,labelWidth) + 10;
    c.weightx=0.0;
    c.gridwidth=1;
    c.insets=new Insets(2,5,2,1);
    for (int i=0; i < l.length; i++)     add(l[i],c);
  }
  c.insets=new Insets(2,15,2,2);
  c.weightx=1.0;
  c.gridwidth=2;
  c.fill=GridBagConstraints.HORIZONTAL;
  add(path,c);
  c.weightx=0.0;
  c.gridwidth=GridBagConstraints.REMAINDER;
  c.fill=GridBagConstraints.HORIZONTAL;
  add(find,c);
}
 

Example 43

From project JavaChat, under directory /ChatClient/src/UI/.

Source file: AddContactUI.java

  30 
vote

public AddContactUI(){
  setTitle("Add New Contact");
  setLayout(null);
  lblUsername=new JLabel("Please enter your contact username.");
  txtUsername=new JTextField();
  btnOK=new JButton("OK");
  btnCancel=new JButton("Cancel");
  lblUsername.setBounds(10,10,275,25);
  txtUsername.setBounds(10,45,275,25);
  btnOK.setBounds(110,100,80,25);
  btnCancel.setBounds(200,100,80,25);
  add(lblUsername);
  add(txtUsername);
  add(btnOK);
  add(btnCancel);
  btnOK.addActionListener(actListener);
  btnCancel.addActionListener(actListener);
  txtUsername.addKeyListener(keyListener);
  setSize(300,170);
  setResizable(false);
  setLocationRelativeTo(UICore.getMasterUI());
  setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
  setVisible(true);
}
 

Example 44

From project JavaOSC, under directory /modules/ui/src/main/java/com/illposed/osc/ui/.

Source file: OscUI.java

  30 
vote

protected void addOscServerAddressPanel(){
  JPanel addressPanel=makeNewJPanel1();
  addressPanel.setBackground(new Color(123,150,123));
  addressWidget=new JTextField("localhost");
  JButton setAddressButton=new JButton("Set Address");
  setAddressButton.addActionListener(new ActionListener(){
    public void actionPerformed(    ActionEvent e){
      addressChanged();
    }
  }
);
  portWidget=new JLabel(Integer.toString(OSCPort.defaultSCOSCPort()));
  portWidget.setForeground(new Color(255,255,255));
  JLabel portLabel=new JLabel("Port");
  portLabel.setForeground(new Color(255,255,255));
  addressPanel.add(setAddressButton);
  addressPanel.add(addressWidget);
  addressPanel.add(portLabel);
  addressPanel.add(portWidget);
  add(addressPanel);
}
 

Example 45

From project JGit, under directory /org.spearce.jgit/src/org/spearce/jgit/transport/.

Source file: DefaultSshSessionFactory.java

  30 
vote

public String[] promptKeyboardInteractive(final String destination,final String name,final String instruction,final String[] prompt,final boolean[] echo){
  final GridBagConstraints gbc=new GridBagConstraints(0,0,1,1,1,1,GridBagConstraints.NORTHWEST,GridBagConstraints.NONE,new Insets(0,0,0,0),0,0);
  final Container panel=new JPanel();
  panel.setLayout(new GridBagLayout());
  gbc.weightx=1.0;
  gbc.gridwidth=GridBagConstraints.REMAINDER;
  gbc.gridx=0;
  panel.add(new JLabel(instruction),gbc);
  gbc.gridy++;
  gbc.gridwidth=GridBagConstraints.RELATIVE;
  final JTextField[] texts=new JTextField[prompt.length];
  for (int i=0; i < prompt.length; i++) {
    gbc.fill=GridBagConstraints.NONE;
    gbc.gridx=0;
    gbc.weightx=1;
    panel.add(new JLabel(prompt[i]),gbc);
    gbc.gridx=1;
    gbc.fill=GridBagConstraints.HORIZONTAL;
    gbc.weighty=1;
    if (echo[i]) {
      texts[i]=new JTextField(20);
    }
 else {
      texts[i]=new JPasswordField(20);
    }
    panel.add(texts[i],gbc);
    gbc.gridy++;
  }
  if (JOptionPane.showConfirmDialog(null,panel,destination + ": " + name,JOptionPane.OK_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) {
    String[] response=new String[prompt.length];
    for (int i=0; i < prompt.length; i++) {
      response[i]=texts[i].getText();
    }
    return response;
  }
  return null;
}
 

Example 46

From project jlac, under directory /src/org/sump/analyzer/.

Source file: DiagramLabels.java

  30 
vote

/** 
 * Constructs diagram labels component.
 */
public DiagramLabels(){
  super();
  setLayout(new GridBagLayout());
  setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
  JPanel modePane=new JPanel();
  modePane.setLayout(new GridBagLayout());
  modePane.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Diagram Labels"),BorderFactory.createEmptyBorder(5,5,5,5)));
  labelFields=new JTextField[32];
  diagramLabels=new String[32];
  for (int col=0; col < 2; col++) {
    for (int row=0; row < 16; row++) {
      int num=16 * col + row;
      modePane.add(new JLabel("Channel " + num + ": "),createConstraints(2 * col,row,1,1,0,0));
      labelFields[num]=new JTextField(20);
      modePane.add(labelFields[num],createConstraints(2 * col + 1,row,1,1,0,0));
      diagramLabels[num]=new String();
    }
  }
  add(modePane,createConstraints(0,0,5,1,0,0));
  JButton ok=new JButton("Ok");
  ok.addActionListener(this);
  add(ok,createConstraints(0,1,1,1,0.34,0));
  JButton cancel=new JButton("Cancel");
  cancel.addActionListener(this);
  add(cancel,createConstraints(1,1,1,1,0.33,0));
  JButton clear=new JButton("Clear");
  clear.addActionListener(this);
  add(clear,createConstraints(2,1,1,1,0.33,0));
}
 

Example 47

From project autopsy, under directory /Core/src/org/sleuthkit/autopsy/casemodule/.

Source file: AddImageVisualPanel1.java

  29 
vote

/** 
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
 */
private void initComponents(){
  buttonGroup1=new javax.swing.ButtonGroup();
  imgPathLabel=new javax.swing.JLabel();
  imgPathTextField=new javax.swing.JTextField();
  imgPathBrowserButton=new javax.swing.JButton();
  this.imgPathBrowserButton.setDefaultCapable(true);
  this.imgPathBrowserButton.requestFocus();
  imgInfoLabel=new javax.swing.JLabel();
  timeZoneComboBox=new javax.swing.JComboBox();
  timeZoneLabel=new javax.swing.JLabel();
  jLabel2=new javax.swing.JLabel();
  noFatOrphansCheckbox=new javax.swing.JCheckBox();
  optionsLabel1=new javax.swing.JLabel();
  setPreferredSize(new java.awt.Dimension(588,328));
  org.openide.awt.Mnemonics.setLocalizedText(imgPathLabel,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.imgPathLabel.text"));
  imgPathTextField.setText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.imgPathTextField.text"));
  org.openide.awt.Mnemonics.setLocalizedText(imgPathBrowserButton,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.imgPathBrowserButton.text"));
  imgPathBrowserButton.addActionListener(new java.awt.event.ActionListener(){
    public void actionPerformed(    java.awt.event.ActionEvent evt){
      imgPathBrowserButtonActionPerformed(evt);
    }
  }
);
  imgInfoLabel.setFont(new java.awt.Font("Tahoma",1,14));
  org.openide.awt.Mnemonics.setLocalizedText(imgInfoLabel,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.imgInfoLabel.text"));
  timeZoneComboBox.setMaximumRowCount(30);
  org.openide.awt.Mnemonics.setLocalizedText(timeZoneLabel,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.timeZoneLabel.text"));
  org.openide.awt.Mnemonics.setLocalizedText(jLabel2,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.jLabel2.text"));
  org.openide.awt.Mnemonics.setLocalizedText(noFatOrphansCheckbox,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.noFatOrphansCheckbox.text"));
  noFatOrphansCheckbox.setToolTipText(org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.noFatOrphansCheckbox.toolTipText"));
  org.openide.awt.Mnemonics.setLocalizedText(optionsLabel1,org.openide.util.NbBundle.getMessage(AddImageVisualPanel1.class,"AddImageVisualPanel1.optionsLabel1.text"));
  javax.swing.GroupLayout layout=new javax.swing.GroupLayout(this);
  this.setLayout(layout);
  layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(imgInfoLabel).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,false).addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup().addComponent(timeZoneLabel).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,javax.swing.GroupLayout.DEFAULT_SIZE,Short.MAX_VALUE).addComponent(timeZoneComboBox,javax.swing.GroupLayout.PREFERRED_SIZE,253,javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(javax.swing.GroupLayout.Alignment.LEADING,layout.createSequentialGroup().addComponent(imgPathLabel).addGap(18,18,18).addComponent(imgPathTextField,javax.swing.GroupLayout.PREFERRED_SIZE,389,javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(imgPathBrowserButton))).addComponent(optionsLabel1).addComponent(jLabel2,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(layout.createSequentialGroup().addGap(10,10,10).addComponent(noFatOrphansCheckbox))).addContainerGap(39,Short.MAX_VALUE)));
  layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(imgInfoLabel).addGap(18,18,18).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(imgPathLabel).addComponent(imgPathTextField,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(imgPathBrowserButton)).addGap(26,26,26).addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(timeZoneLabel).addComponent(timeZoneComboBox,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(18,18,18).addComponent(optionsLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(noFatOrphansCheckbox).addGap(18,18,Short.MAX_VALUE).addComponent(jLabel2,javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE).addGap(20,20,20)));
}
 

Example 48

From project enclojure, under directory /netbeans/plugins/org-enclojure-plugin/src/main/java/org/enclojure/ide/nb/source/.

Source file: CljSourceWizardPanel1.java

  29 
vote

public Component getComponent(){
  if (component == null) {
    component=new CljSourceVisualPanel1();
    ((JTextField)component.packagesComboBox.getEditor().getEditorComponent()).getDocument().addDocumentListener(this);
    component.filenameTextField.getDocument().addDocumentListener(this);
  }
  return component;
}
 

Example 49

From project Euclidean-Pattern-Generator, under directory /src/com/hisschemoller/sequencer/view/components/.

Source file: Controls.java

  29 
vote

public Controls(EPGSwingEngine swingEngine){
  _playButton=(JToggleButton)swingEngine.find("PLAY_BUTTON");
  _playButton.addActionListener(this);
  _allNotesOffButton=(JButton)swingEngine.find("ALL_NOTES_OFF_BUTTON");
  _allNotesOffButton.addActionListener(this);
  _tempoSlider=(JSlider)swingEngine.find("TEMPO_SLIDER");
  _tempoSlider.addChangeListener(this);
  _tempoInput=(JFormattedTextField)swingEngine.find("TEMPO_INPUT");
  _tempoInput.setPreferredSize(new Dimension(60,_tempoInput.getPreferredSize().height));
  _tempoInput.addActionListener(this);
  _midiOutBox=(JComboBox)swingEngine.find("MIDI_OUT_BOX");
  _midiOutBox.addActionListener(this);
  _midiCheckBox=(JCheckBox)swingEngine.find("MIDI_CHECKBOX");
  _midiCheckBox.addActionListener(this);
  _oscTextField=(JTextField)swingEngine.find("OSC_TEXTFIELD");
  _oscTextField.addActionListener(this);
  _oscCheckBox=(JCheckBox)swingEngine.find("OSC_CHECKBOX");
  _oscCheckBox.addActionListener(this);
}
 

Example 50

From project Holo-Edit, under directory /holoedit/functions/.

Source file: DoubleParam.java

  29 
vote

public void init(){
  setFont(f);
  setSelectedTextColor(selColor);
  setAutoscrolls(false);
  setVisible(true);
  setHorizontalAlignment(JTextField.CENTER);
  setSize(w,h);
  addFocusListener(this);
  addKeyListener(this);
}
 

Example 51

From project jMemorize, under directory /src/jmemorize/gui/swing/panels/.

Source file: CardCounterPanel.java

  29 
vote

private void initComponents(int target){
  removeAll();
  setLayout(new BorderLayout());
  if (m_cardsTarget > -1) {
    if (USE_PIECHART) {
      m_pieDataset=new DefaultPieDataset();
      m_pieDataset.setValue(Localization.get(LC.STATUS_LEARNED),0);
      m_pieDataset.setValue(Localization.get(LC.STATUS_PARTIAL),0);
      m_pieDataset.setValue(Localization.get(LC.STATUS_UNLEARNED),m_cardsTarget);
      add(buildPiePanel(),BorderLayout.CENTER);
    }
 else {
      if (USE_EXTENT_BAR)       m_bar=buildExtentProgressBar();
 else       if (USE_PARTIAL_BAR)       m_bar=buildPartialProgressBar();
 else       m_bar=new JProgressBar();
      m_bar.setMaximum(target);
      m_bar.setMinimum(0);
      m_bar.setStringPainted(true);
      m_bar.setString(getCardString());
      m_bar.setValue(0);
      add(m_bar,BorderLayout.CENTER);
    }
  }
 else {
    m_textField.setText(getCardString());
    m_textField.setHorizontalAlignment(JTextField.CENTER);
    m_textField.setEditable(false);
    add(m_textField,BorderLayout.CENTER);
  }
  setPreferredSize(new Dimension(140,USE_PIECHART ? 140 : 22));
}