private static void createAndShowGUI() { // Settings OLD_TF.setToolTipText("Use Ctrl+v or Command+v to paste text"); NEW_TF.setToolTipText("Use Ctrl+v or Command+v to paste text"); REASON_TF.setToolTipText("Enter an optional edit summary"); BAR.setStringPainted(true); BAR.setString(String.format("Hello, %s! :-)", wiki.whoami())); BUTTON.addActionListener(e -> new Thread(new GRThread()).start()); // Create GUI JFrame f = FGUI.simpleJFrame(TITLE, 3, true); f.getContentPane() .add( FGUI.buildForm( "Replacement", new JLabel("Old Title: "), OLD_TF, new JLabel("New Title: "), NEW_TF, new JLabel("Summary: "), REASON_TF), "Center"); f.getContentPane().add(FGUI.boxLayout(1, FGUI.simpleJPanel(BUTTON), BAR), "South"); FGUI.setJFrameVisible(f); }
@Override void showErrMsgAsToolTip(SvmValidationException e) { if (comboBoxAnrede != null && e.getAffectedFields().contains(Field.ANREDE)) { comboBoxAnrede.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.VORNAME)) { txtVorname.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.NACHNAME)) { txtNachname.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.STRASSE_HAUSNUMMER)) { txtStrasseHausnummer.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.PLZ)) { txtPlz.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.ORT)) { txtOrt.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.FESTNETZ)) { txtFestnetz.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.NATEL)) { txtNatel.setToolTipText(e.getMessage()); } if (e.getAffectedFields().contains(Field.EMAIL)) { txtEmail.setToolTipText(e.getMessage()); } if (errLblGeburtsdatum != null && e.getAffectedFields().contains(Field.GEBURTSDATUM)) { txtGeburtsdatum.setToolTipText(e.getMessage()); } }
/** build the editor */ public java.awt.Component getCustomEditor() { _theHolder = new JPanel(); java.awt.BorderLayout bl1 = new java.awt.BorderLayout(); bl1.setVgap(0); bl1.setHgap(0); java.awt.BorderLayout bl2 = new java.awt.BorderLayout(); bl2.setVgap(0); bl2.setHgap(0); JPanel lPanel = new JPanel(); lPanel.setLayout(bl1); JPanel rPanel = new JPanel(); rPanel.setLayout(bl2); _theHolder.setLayout(new java.awt.GridLayout(0, 2)); _theDate = new JTextField(); _theDate.setToolTipText("Format: " + NULL_DATE); _theTime = new JTextField(); _theTime.setToolTipText("Format: " + NULL_TIME); lPanel.add("Center", new JLabel("Date:", JLabel.RIGHT)); lPanel.add("East", _theDate); rPanel.add("Center", new JLabel("Time:", JLabel.RIGHT)); rPanel.add("East", _theTime); _theHolder.add(lPanel); _theHolder.add(rPanel); // get the fields to select the full text when they're selected _theDate.addFocusListener(this); _theTime.addFocusListener(this); // right, just see if we are in hi-res DTG editing mode if (HiResDate.inHiResProcessingMode()) { // ok, add a button to allow the user to enter DTG data JButton editMicros = new JButton("Micros"); editMicros.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { editMicrosPressed(); } }); // ok, we' _theMicrosTxt = new JLabel(".."); _theHolder.add(_theMicrosTxt); _theHolder.add(editMicros); } resetData(); return _theHolder; }
private void filterValidStateChanged(LogView4JEvent event) { Boolean isValid = (Boolean) event.get(LogView4JEventKey.FILTER_VALID); if (Boolean.TRUE.equals(isValid)) { quickFilterTextField.setToolTipText("Quick filter"); quickFilterTextField.setBackground(Color.WHITE); quickFilterTextField.setForeground(Color.BLACK); } else { String error = (String) event.get(LogView4JEventKey.ERROR_MESSAGE); quickFilterTextField.setToolTipText("Quick filter : " + error); quickFilterTextField.setBackground(INVALID_COLOR); quickFilterTextField.setForeground(Color.WHITE); } }
protected JComponent createNorthPanel() { class MyTextField extends JTextField { public MyTextField() { super(""); } public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); return new Dimension(200, d.height); } } JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(4, 0, 8, 8); gbConstraints.fill = GridBagConstraints.VERTICAL; gbConstraints.weightx = 0; gbConstraints.weighty = 1; gbConstraints.anchor = GridBagConstraints.EAST; JLabel label = new JLabel(IdeBundle.message("editbox.line.number")); panel.add(label, gbConstraints); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 1; myField = new MyTextField(); panel.add(myField, gbConstraints); myField.setToolTipText(IdeBundle.message("tooltip.syntax.linenumber.columnnumber")); LogicalPosition position = myEditor.getCaretModel().getLogicalPosition(); myField.setText(String.format("%d:%d", position.line + 1, position.column + 1)); if (isInternal()) { gbConstraints.gridy = 1; gbConstraints.weightx = 0; gbConstraints.weighty = 1; gbConstraints.anchor = GridBagConstraints.EAST; final JLabel offsetLabel = new JLabel("Offset:"); panel.add(offsetLabel, gbConstraints); gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 1; myOffsetField = new MyTextField(); panel.add(myOffsetField, gbConstraints); myOffsetField.setToolTipText(String.valueOf(myEditor.getCaretModel().getOffset())); } return panel; }
@Override public JComponent createUI( DescriptionType inputOrOutput, Map<URI, Object> dataMap, Orientation orientation) { // Create the main panel JComponent component = new JPanel(new MigLayout("fill")); boolean isOptional = false; if (inputOrOutput instanceof InputDescriptionType) { isOptional = ((InputDescriptionType) inputOrOutput).getMinOccurs().equals(new BigInteger("0")); } // Display the SourceCA into a JTextField JTextField jtf = new JTextField(); jtf.setToolTipText(inputOrOutput.getAbstract().get(0).getValue()); // "Save" the CA inside the JTextField jtf.getDocument().putProperty(DATA_MAP_PROPERTY, dataMap); URI uri = URI.create(inputOrOutput.getIdentifier().getValue()); jtf.getDocument().putProperty(URI_PROPERTY, uri); // add the listener for the text changes in the JTextField jtf.getDocument() .addDocumentListener( EventHandler.create(DocumentListener.class, this, "saveDocumentText", "document")); if (isOptional) { if (dataMap.containsKey(uri)) { jtf.setText(dataMap.get(uri).toString()); } } GeometryData geometryData = null; if (inputOrOutput instanceof InputDescriptionType) { geometryData = (GeometryData) ((InputDescriptionType) inputOrOutput).getDataDescription().getValue(); } // If the DescriptionType is an output, there is nothing to show, so exit if (geometryData == null) { return null; } component.add(jtf, "growx"); if (orientation.equals(Orientation.VERTICAL)) { JPanel buttonPanel = new JPanel(new MigLayout()); // Create the button Browse JButton pasteButton = new JButton(ToolBoxIcon.getIcon(ToolBoxIcon.PASTE)); // "Save" the sourceCA and the JTextField in the button pasteButton.putClientProperty(TEXT_FIELD_PROPERTY, jtf); pasteButton.setBorderPainted(false); pasteButton.setContentAreaFilled(false); pasteButton.setMargin(new Insets(0, 0, 0, 0)); // Add the listener for the click on the button pasteButton.addActionListener(EventHandler.create(ActionListener.class, this, "onPaste", "")); buttonPanel.add(pasteButton); component.add(buttonPanel, "dock east"); } return component; }
/** * Pattern widget * * @return Pattern widget */ public JTextField getPatternWidget() { if (patternFld == null) { patternFld = new JTextField(pattern, 20); patternFld.setToolTipText( "<html>A string pattern to match or a comma separated numeric range:<br><i>e.g., -5.0,0</i></html>"); } return patternFld; }
public void initUI() { scrollingToBottomCheckbox.setSelected(applicationPreferences.isScrollingToBottom()); coloringWholeRowCheckbox.setSelected(applicationPreferences.isColoringWholeRow()); showFullCallstackCheckbox.setSelected(applicationPreferences.isShowingFullCallstack()); showStackTraceCheckbox.setSelected(applicationPreferences.isShowingStackTrace()); usingWrappedExceptionStyleCheckbox.setSelected( applicationPreferences.isUsingWrappedExceptionStyle()); // look and feel { ArrayList<String> lookAndFeels = new ArrayList<>(); for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { lookAndFeels.add(info.getName()); } Collections.sort(lookAndFeels); int selectedIndex = 0; String lookAndFeel = applicationPreferences.getLookAndFeel(); if (lookAndFeel == null || "".equals(lookAndFeel)) { lookAndFeel = UIManager.getLookAndFeel().getName(); } int idx = lookAndFeels.indexOf(lookAndFeel); if (idx > -1) { selectedIndex = idx; } else { idx = lookAndFeels.indexOf(ApplicationPreferences.STARTUP_LOOK_AND_FEEL); if (idx > -1) { selectedIndex = idx; } } lookAndFeelCombo.setModel( new DefaultComboBoxModel<>(lookAndFeels.toArray(new String[lookAndFeels.size()]))); lookAndFeelCombo.setSelectedIndex(selectedIndex); } // default condition name { List<String> conditionNames = applicationPreferences.retrieveAllConditions(); String defaultName = applicationPreferences.getDefaultConditionName(); int idx = conditionNames.indexOf(defaultName); if (idx < 0) { idx = 0; } defaultConditionCombo.setModel( new DefaultComboBoxModel<>(conditionNames.toArray(new String[conditionNames.size()]))); defaultConditionCombo.setSelectedIndex(idx); } String appPath = applicationPreferences.getApplicationPath().getAbsolutePath(); appPathTextField.setText(appPath); appPathTextField.setToolTipText(appPath); globalLoggingEnabledCheckbox.setSelected(applicationPreferences.isGlobalLoggingEnabled()); loggingStatsEnabledCheckbox.setSelected(applicationPreferences.isLoggingStatisticEnabled()); trayActiveCheckbox.setSelected(applicationPreferences.isTrayActive()); trayActiveCheckbox.setEnabled(TraySupport.isAvailable()); hidingOnCloseCheckbox.setSelected(applicationPreferences.isHidingOnClose()); hidingOnCloseCheckbox.setEnabled(TraySupport.isAvailable()); }
/** Constructor */ public QualityFeedbackWizard() { super(Main.getWindow(), Messages.getString("JajukJMenuBar.19")); // $NON-NLS-1$ getContentPane().setPreferredSize(new Dimension(600, 250)); // From jlFrom = new JLabel(Messages.getString("QualityFeedbackWizard.1")); // $NON-NLS-1$ jlFrom.setToolTipText(Messages.getString("QualityFeedbackWizard.2")); // $NON-NLS-1$ jtfFrom = new JTextField(); jtfFrom.setToolTipText(Messages.getString("QualityFeedbackWizard.2")); // $NON-NLS-1$ // Description jlDesc = new JLabel(Messages.getString("QualityFeedbackWizard.3")); // $NON-NLS-1$ jlDesc.setToolTipText(Messages.getString("QualityFeedbackWizard.4")); // $NON-NLS-1$ jtfDesc = new JTextField(); jtfDesc.setToolTipText(Messages.getString("QualityFeedbackWizard.4")); // $NON-NLS-1$ jtfDesc.addKeyListener(this); // Details jlDetail = new JLabel(Messages.getString("QualityFeedbackWizard.5")); // $NON-NLS-1$ jlDetail.setToolTipText(Messages.getString("QualityFeedbackWizard.6")); // $NON-NLS-1$ jtaDetail = new JTextArea(); jtaDetail.setToolTipText(Messages.getString("QualityFeedbackWizard.6")); // $NON-NLS-1$ okp = new OKCancelPanel(this); okp.getOKButton().setEnabled(false); jpMain = new JPanel(); int iXSeparator = 10; int iYSeparator = 20; double[][] dSize = { {iXSeparator, 0.3, iXSeparator, 0.7, iXSeparator}, {iYSeparator, 20, iYSeparator, 20, iYSeparator, 60, 3 * iYSeparator, 20, iYSeparator} }; jpMain.setLayout(new TableLayout(dSize)); jpMain.add(jlFrom, "1,1"); // $NON-NLS-1$ jpMain.add(jtfFrom, "3,1"); // $NON-NLS-1$ jpMain.add(jlDesc, "1,3"); // $NON-NLS-1$ jpMain.add(jtfDesc, "3,3"); // $NON-NLS-1$ jpMain.add(jlDetail, "1,5"); // $NON-NLS-1$ jpMain.add(jtaDetail, "3,5"); // $NON-NLS-1$ jpMain.add(okp, "3,7"); // $NON-NLS-1$ getContentPane().add(jpMain); addWindowListener( new WindowAdapter() { public void windowActivated(WindowEvent e) { jtfFrom.requestFocusInWindow(); } }); getRootPane().setDefaultButton(okp.getOKButton()); }
public static Settings init() throws Exception { File f = new File("galaxyviewer.ini"); if (f.getAbsoluteFile().getParentFile().getName().equals("bin")) f = new File("..", "galaxyviewer.ini"); Settings settings; if (f.exists()) { settings = new Settings(); BufferedReader in = new BufferedReader(new FileReader(f)); while (true) { String s = in.readLine(); if (s == null) break; if (s.contains("=") == false) continue; String[] el = s.split("=", -1); if (el[0].equalsIgnoreCase("PlayerNr")) settings.playerNr = Integer.parseInt(el[1].trim()) - 1; if (el[0].equalsIgnoreCase("GameName")) settings.gameName = el[1].trim(); if (el[0].equalsIgnoreCase("GameDir")) settings.directory = el[1].trim(); } in.close(); } else settings = new Settings(); JTextField pNr = new JTextField("" + (settings.playerNr + 1)); JTextField gName = new JTextField(settings.gameName); JTextField dir = new JTextField("" + settings.directory); JPanel p = new JPanel(); p.setLayout(new GridLayout(3, 2)); p.add(new JLabel("Player nr")); p.add(pNr); p.add(new JLabel("Game name")); p.add(gName); p.add(new JLabel("Game directory")); p.add(dir); gName.setToolTipText("Do not include file extensions"); String[] el = {"Ok", "Cancel"}; int ok = JOptionPane.showOptionDialog( null, p, "Choose settings", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, el, el[0]); if (ok != 0) System.exit(0); settings.playerNr = Integer.parseInt(pNr.getText().trim()) - 1; settings.directory = dir.getText().trim(); settings.gameName = gName.getText().trim(); BufferedWriter out = new BufferedWriter(new FileWriter(f)); out.write("PlayerNr=" + (settings.playerNr + 1) + "\n"); out.write("GameName=" + settings.gameName + "\n"); out.write("GameDir=" + settings.directory + "\n"); out.flush(); out.close(); return settings; }
public static void framecreation() { int framesizex = 400; int framesizey = 600; frame = new JFrame("TwitchBot: Connection-Window"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setResizable(false); JPanel panel = new JPanel(); panel.setLayout(null); status = new JLabel(); status.setText("Bereit"); status.setBounds(50, 550, 300, 15); JLabel statusbeschr = new JLabel(); statusbeschr.setBounds(5, 550, 50, 15); statusbeschr.setText("Status: "); JLabel twitchnamelabel = new JLabel("Twitch Name"); twitchnamelabel.setBounds(10, 50, 80, 25); JTextField twitchname = new JTextField("Twitch Channel"); twitchname.setBounds(90, 50, 300, 25); twitchname.setText(main.Streamername); twitchname.setToolTipText("Enter here your Twitch Name."); JButton connect = new JButton(); connect.setBounds(270, 520, 100, 25); connect.setText("Verbinden"); connect.setToolTipText("Connect"); connect.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { main.botconnection(); } }); JButton cancel = new JButton(); cancel.setBounds(30, 520, 100, 25); cancel.setText("Abbrechen"); cancel.setToolTipText("Cancel"); panel.add(connect); panel.add(twitchnamelabel); panel.add(twitchname); panel.add(cancel); panel.add(statusbeschr); panel.add(status); frame.add(panel); Dimension screensize = Toolkit.getDefaultToolkit().getScreenSize(); frame.setSize(framesizex, framesizey); frame.setLocation( screensize.width / 2 - frame.getSize().width / 2, screensize.height / 2 - frame.getSize().height / 2); frame.setVisible(true); }
public JTextField getLoginField() { if (loginField == null) { loginField = new JTextField(); int strSize = 50; loginField.setDocument(new TextDocument(strSize)); loginField.setToolTipText("Informe o login do usuário"); loginField.setColumns(10); } return loginField; }
public JTextField getNomeField() { if (nomeField == null) { nomeField = new JTextField(); int strSize = 50; nomeField.setDocument(new TextDocument(strSize)); nomeField.setToolTipText("Informe nome do usuário"); nomeField.setColumns(15); } return nomeField; }
/** * This method initializes jTextFieldStaffID * * @return javax.swing.JTextField */ private JTextField getJTextFieldStaffID() { if (jTextFieldStaffID == null) { jTextFieldStaffID = new JTextField(); jTextFieldStaffID.setBounds(new Rectangle(376, 239, 181, 33)); jTextFieldStaffID.setText(""); jTextFieldStaffID.setToolTipText("Enter your staff ID here"); jTextFieldStaffID.setColumns(0); } return jTextFieldStaffID; }
private void init() { send.setText(Messages.getString("FaceMe.postit")); send.setToolTipText(Messages.getString("FaceMe.tooltip")); feel.setToolTipText(Messages.getString("FaceMe.tooltip")); send.setEnabled(false); setLayout(new GridLayout(3, 1)); add(nick); add(feel); add(send); }
/** adds all the gui components to the panel. */ private void setupPanel() { this.setLayout(baseLayout); this.add(chatArea); this.add(typingField); this.add(promptLabel); this.add(submitButton); this.add(twitterButton); this.add(analyzeTwitterButton); typingField.setToolTipText("Type here for the chatbot"); chatArea.setEnabled(false); }
/** Create the frame. */ public Frame() { setIconImage( Toolkit.getDefaultToolkit() .getImage( Frame.class.getResource("/nl/compra/CompraSiteMapperGUI/Resources/compra.png"))); setTitle("Compra Sitemap Generator"); setResizable(false); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { // TODO Auto-generated catch block e.printStackTrace(); } setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 668, 455); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); getContentPane().setLayout(null); contentPane.setLayout(null); JLabel lblUrl = new JLabel("URL:"); lblUrl.setBounds(6, 11, 28, 16); getContentPane().add(lblUrl); textFieldURL = new JTextField(); textFieldURL.setHorizontalAlignment(SwingConstants.LEFT); textFieldURL.setBounds(32, 5, 499, 28); textFieldURL.setToolTipText("Enter a URL for the crawler to crawl"); getContentPane().add(textFieldURL); textFieldURL.setColumns(10); JButton btnCrawl = new JButton("Crawl"); btnCrawl.setBounds(541, 5, 108, 28); btnCrawl.setAction(action); getContentPane().add(btnCrawl); JScrollPane scrollPane_1 = new JScrollPane(); scrollPane_1.setBounds(6, 39, 643, 373); getContentPane().add(scrollPane_1); textAreaLog = new JTextArea(); scrollPane_1.setViewportView(textAreaLog); textAreaLog.setDropMode(DropMode.INSERT); textAreaLog.setTabSize(4); }
@Override protected void testInput() { String text = null; if (field instanceof ColoredJPasswordField) text = new String(((ColoredJPasswordField) field).getPassword()); else text = ((ColoredJTextField) field).getText(); if (text.length() == 0) { field.setDefault(); correctness = false; } else { if (text.matches(wordsymb)) { field.setDefault(); correctness = true; ((JTextField) field).setToolTipText(null); } else { field.setDenied(); correctness = false; ((JTextField) field).setToolTipText(notwordsymbols); } } correctlistener.checkCorrectness(); }
public boolean okPressed(JDialog parent) { if (!(conditions.getSelectedItem().equals("==") || conditions.getSelectedItem().equals("!="))) { try { Double.parseDouble(value.getText()); return true; } catch (NumberFormatException e) { value.setBackground(Color.red); value.setToolTipText("Expected numeric value for this type of condition"); return false; } } return true; }
private void setupPanel() /** delcaring the data member inside the class */ { this.setPanel(BasePanel); this.setLayout(baseLayout); this.add(firstButton); this.add(TextField); this.setBackground(Color.GREEN); this.add(promptLabel); add(tweetButton); chatArea.setEnabled(false); TextField.setToolTipText(""); }
public void addItem(String name) { JTextField txtItem = new JTextField(); txtItem.setEditable(false); txtItem.setBorder(BorderFactory.createLoweredBevelBorder()); txtItem.setToolTipText(Messages.getString(name)); Dimension dim = new Dimension(100, 20); txtItem.setMinimumSize(dim); txtItem.setMaximumSize(dim); txtItem.setPreferredSize(dim); _items.put(name, txtItem); _statusPanel.add(txtItem); }
/** * This method initializes jTextField * * @return javax.swing.JTextField */ public JTextField getTxtName() { if (txtName == null) { txtName = new JTextField(); txtName.setBounds(6, 19, 472, 20); txtName.setText(PluginServices.getText(this, "WFSLayer")); txtName.setEditable(false); txtName.setBackground(Color.WHITE); txtName.setToolTipText(PluginServices.getText(txtName, "feature_to_load")); txtName .getDocument() .addDocumentListener( new DocumentListener() { /* * (non-Javadoc) * * @see * javax.swing.event.DocumentListener#changedUpdate(javax.swing * .event.DocumentEvent) */ public void changedUpdate(DocumentEvent e) {} /* * (non-Javadoc) * * @see * javax.swing.event.DocumentListener#insertUpdate(javax.swing * .event.DocumentEvent) */ public void insertUpdate(DocumentEvent e) { IPanelGroup panelGroup = getPanelGroup(); if (panelGroup == null) return; ((WFSParamsPanel) panelGroup).setApplicable(true); } /* * (non-Javadoc) * * @see * javax.swing.event.DocumentListener#removeUpdate(javax.swing * .event.DocumentEvent) */ public void removeUpdate(DocumentEvent e) {} }); } return txtName; }
public void init() { // DEBUG=true; if (DEBUG) System.out.println("DirTable:init:start"); getModel().setTable(this); addMouseListener(this); this.setAutoResizeMode(AUTO_RESIZE_ALL_COLUMNS); // colorRenderer = new ColorRenderer(getModel()); centerRenderer = new DefaultTableCellRenderer(); centerRenderer.setHorizontalAlignment(JLabel.CENTER); initColumnSizes(); /* this.getTableHeader().setToolTipText( _("Click to sort; Shift-Click to sort in reverse order")); this.setAutoCreateRowSorter(true);*/ DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); getColumnModel().getColumn(DirModel.TABLE_COL_NAME).setCellRenderer(renderer); getColumnModel() .getColumn(DirModel.TABLE_COL_NAME) .setCellEditor(new DefaultCellEditor(getModel().getComboBox(null))); getColumnModel() .getColumn(DirModel.TABLE_COL_MODE) .setCellRenderer(new DefaultTableCellRenderer()); getColumnModel() .getColumn(DirModel.TABLE_COL_MODE) .setCellEditor(new DefaultCellEditor(getModel().getModeComboBox())); getColumnModel() .getColumn(DirModel.TABLE_COL_INSTANCE) .setCellRenderer(new DefaultTableCellRenderer()); getColumnModel() .getColumn(DirModel.TABLE_COL_INSTANCE) .setCellEditor(new DefaultCellEditor(getModel().getInstanceComboBox())); JTextField expiration = new JTextField(); expiration.setToolTipText("test"); // getColumnModel().getColumn(UpdatesModel.TABLE_COL_QOT_ROT).setCellRenderer(new // PanelRenderer()); // getColumnModel().getColumn(UpdatesModel.TABLE_COL_QOT_ROT).setCellEditor(new // MyPanelEditor()); getColumnModel() .getColumn(DirModel.TABLE_COL_EXPIRATION) .setCellRenderer(new DefaultTableCellRenderer()); getColumnModel() .getColumn(DirModel.TABLE_COL_EXPIRATION) .setCellEditor(new DefaultCellEditor(expiration)); getModel().update(null, null); if (DEBUG) System.out.println("dirTable:init:done"); // his.setPreferredScrollableViewportSize(new Dimension(DIM_X, DIM_Y)); // DEBUG=false; }
/** * Creates new form NewFlurstueckPanel. * * @param schluessel DOCUMENT ME! */ public CreateFlurstueckPanel(final FlurstueckSchluesselCustomBean schluessel) { this.schluessel = schluessel; initComponents(); cboFlur.setToolTipText("Flur"); txtFlurstueck.setToolTipText("Flurstueck"); txtFlurstueck.setEnabled(false); cboGemarkung.setEditable(false); cboFlur.setEditable(false); cboGemarkung.setToolTipText("Gemarkung"); btnCreateNewFlurstueck.setEnabled(false); txtFlurstueck.getDocument().addDocumentListener(this); txtFlurstueck.addActionListener(this); try { final Thread keyRetrieverThread = new Thread() { @Override public void run() { if (log.isDebugEnabled()) { log.debug("Abrufen der Gemarkungen vom Server"); } final Collection gemKeys = CidsBroker.getInstance().getGemarkungsKeys(); if (gemKeys != null) { final Vector gemKeyList = new Vector(gemKeys); Collections.sort(gemKeyList); cboGemarkung.setModel(new KeyComboboxModel(gemKeyList)); cboGemarkung.setEnabled(true); } else { cboGemarkung.setModel(new KeyComboboxModel()); } if (schluessel != null) { if (log.isDebugEnabled()) { log.debug("Current Gemarkung: " + schluessel.getGemarkung()); } cboGemarkung.setSelectedItem(schluessel.getGemarkung()); cboGemarkung.getEditor().setItem(schluessel.getGemarkung()); } } }; keyRetrieverThread.setPriority(Thread.NORM_PRIORITY); keyRetrieverThread.start(); } catch (Exception ex) { log.error("Fehler beim Abrufen der Gemarkungen"); } }
public ScheduleOptionsFrame(ScheduleEditFrame sef) { super(); // the following code sets the frame's initial state getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS)); _track = sef._track; // load the panel // row 1 JPanel pFactor = new JPanel(); pFactor.setLayout(new GridBagLayout()); pFactor.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("ScheduleFactor"))); addItem(pFactor, factorTextField, 0, 0); factorTextField.setToolTipText(Bundle.getMessage("TipScheduleFactor")); factorTextField.setText(Integer.toString(_track.getReservationFactor())); // row 2 JPanel pAlternate = new JPanel(); pAlternate.setLayout(new GridBagLayout()); pAlternate.setBorder(BorderFactory.createTitledBorder(Bundle.getMessage("AlternateTrack"))); addItem(pAlternate, trackBox, 0, 0); _track.getLocation().updateComboBox(trackBox); trackBox.removeItem(_track); // remove this track from consideration trackBox.setSelectedItem(_track.getAlternateTrack()); JPanel pControls = new JPanel(); pControls.add(saveButton); // button action addButtonAction(saveButton); getContentPane().add(pFactor); getContentPane().add(pAlternate); getContentPane().add(pControls); setTitle(Bundle.getMessage("MenuItemScheduleOptions")); pack(); setMinimumSize(new Dimension(Control.panelWidth300, Control.panelHeight200)); setVisible(true); }
public AccesoSistema() { super("Ingreso Al Sistema"); setSize(400, 200); // el tamaño de la venta setLocationRelativeTo(null); // es para que la pantalla aparezaca en el centro setLayout(null); setVisible(true); // para mostrar la ventana // esta parte de arriba es el constructor : es el que le premite crear componentes lblimagen.setIcon(getClass().getResource("/Imagenes/Escudo.png")); lblimagen.setBounds(270, 10, 120, 140); this.add(lblimagen); lblusuario = new JLabel("Usuario: "); lblclave = new JLabel("Contraseña: "); txtusuario = new JTextField(""); txtclave = new JPasswordField(""); btningresar = new JButton("Ingresar"); txtusuario.addActionListener(this); txtclave.addActionListener(this); btningresar.addActionListener(this); // Ponemos A Escuchar El Boton btnsalir = new JButton("Salir"); btnsalir.addActionListener(this); lblusuario.setBounds(20, 20, 80, 25); lblclave.setBounds(20, 60, 80, 25); txtusuario.setBounds(130, 20, 120, 25); txtclave.setBounds(130, 60, 120, 25); btningresar.setBounds(20, 100, 120, 25); btnsalir.setBounds(150, 100, 120, 25); lblusuario.setForeground(new Color(0, 0, 0)); // lblusuario.setBorder(BorderFactory.createLineBorder(Color.yellow, WIDTH));//sirve para // mostrar el tamaño del lbl txtusuario.setBackground(Color.WHITE); // este es para darle color a la caja de texto txtusuario.setToolTipText("Ingrese Su Usuario"); // sirve para mostrar mensajes emergentes this.add(lblusuario); this.add(lblclave); this.add(txtusuario); this.add(txtclave); this.add(btningresar); this.add(btnsalir); this.repaint(); }
/** * Create the _view. * * @throws SQLException */ public RemoveReaderInternalFrame(ILibrary library) throws SQLException { _model = library; setTitle("Remove Reader"); int textFieldCharactersLimit = 25; setClosable(true); setBounds(100, 100, 600, 300); getContentPane().setLayout(null); _textFieldSearch = new JTextField(); _textFieldSearch.setBounds(170, 236, 244, 23); _textFieldSearch.setToolTipText("Search Field"); _textFieldSearch.setColumns(10); _textFieldSearch.setDocument(new JTextFieldLimit(textFieldCharactersLimit)); getContentPane().add(_textFieldSearch); _readerModel = new DefaultListModel<Reader>(); _filteredListModel = new FilteredListModel(_readerModel); _readersList = new JList<Reader>(_filteredListModel); _readersList.addListSelectionListener( new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { setEnabledBtnRemoveReader(true); } }); _readersList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); _readersList.setBounds(10, 52, 414, 173); _btnRemoveReader = new JButton("Remove Reader"); _btnRemoveReader.setEnabled(false); _btnRemoveReader.setBounds(10, 236, 150, 23); getContentPane().add(_btnRemoveReader); _btnCancel = new JButton("Cancel"); _btnCancel.setBounds(424, 236, 150, 23); getContentPane().add(_btnCancel); JScrollPane scrollPane = new JScrollPane(_readersList); scrollPane.setBounds(10, 11, 564, 214); getContentPane().add(scrollPane); }
protected Component createQueryComponent() { JComponent panel = new JPanel(new BorderLayout()); getChooser(); Action[] navActs = chooser_.getNavigationActions(); setToolbarActions(navActs); JMenu navMenu = new JMenu("Navigation"); navMenu.setMnemonic(KeyEvent.VK_N); for (int i = 0; i < navActs.length; i++) { navMenu.add(navActs[i]); } setMenus(new JMenu[] {navMenu}); panel.add(chooser_, BorderLayout.CENTER); JLabel posLabel = new JLabel("Position in file: #"); posField_ = new JTextField(6); posField_.addActionListener(getSubmitAction()); String posHelp = "HDU index for FITS files or TABLE index for VOTables" + " (optional)"; posField_.setToolTipText(posHelp); posLabel.setToolTipText(posHelp); JComponent formatBox = Box.createHorizontalBox(); formatBox.add(new JLabel("Table Format: ")); formatBox.add(new ShrinkWrapper(createFormatSelector())); formatBox.add(Box.createHorizontalStrut(10)); formatBox.add(Box.createHorizontalGlue()); formatBox.add(new JLabel("Position in file: #")); formatBox.add(new ShrinkWrapper(posField_)); formatBox.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); panel.add(formatBox, BorderLayout.SOUTH); /* Make sure that the file list is refreshed every time the window * is made visible. */ panel.addAncestorListener( new AncestorListener() { public void ancestorAdded(AncestorEvent evt) { chooser_.refreshList(); } public void ancestorRemoved(AncestorEvent evt) {} public void ancestorMoved(AncestorEvent evt) {} }); return panel; }
private JPanel buildSnipeSettings() { JPanel tp = new JPanel(); JLabel jl = new JLabel("How close to snipe (in seconds):"); tp.setBorder(BorderFactory.createTitledBorder("Snipe Timing")); tp.setLayout(new BorderLayout()); snipeTime = new JTextField(); snipeTime.addMouseListener(JPasteListener.getInstance()); snipeTime.setToolTipText("Number of seconds prior to auction end to fire a snipe."); snipeTime.setEditable(true); snipeTime .getAccessibleContext() .setAccessibleName("Default number of seconds prior to auction end to fire a snipe."); tp.add(jl, BorderLayout.NORTH); tp.add(snipeTime, BorderLayout.SOUTH); return (tp); }
private void setModelGeburtsdatum(boolean showRequiredErrMsg) throws SvmValidationException { makeErrorLabelInvisible(Field.GEBURTSDATUM); try { personModel.setGeburtsdatum(txtGeburtsdatum.getText()); } catch (SvmRequiredException e) { LOGGER.trace("PersonController setModelGeburtsdatum RequiredException=" + e.getMessage()); if (isModelValidationMode() || !showRequiredErrMsg) { txtGeburtsdatum.setToolTipText(e.getMessage()); // Keine weitere Aktion. Die Required-Prüfung erfolgt erneut nachdem alle Field-Prüfungen // bestanden sind. } else { showErrMsg(e); } throw e; } catch (SvmValidationException e) { LOGGER.trace("PersonController setModelGeburtsdatum Exception=" + e.getMessage()); showErrMsg(e); throw e; } }