There are 3 code examples for javax.swing.event.DocumentListener.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: jbidwatcher Package: com.jbidwatcher.ui
Source Code: JBidToolBar.java (Click to view .java file)
Method Code:
/**
* Add selection/search bar.
* @param inAction - The action to be triggered by the search/select process.
* @return - A component containing the search / select field.
*/
private JComponent establishSearchBox(final JTabManager inAction){
DocumentListener selectListener=new DocumentListener(){
public void insertUpdate( DocumentEvent de){
}
public void changedUpdate( DocumentEvent de){
}
public void removeUpdate( DocumentEvent de){
}
}
;
JConfigTab.adjustField(mSelectBox,"Search and select items from the current table.",selectListener);
ActionListener doSearch=new ActionListener(){
public void actionPerformed( ActionEvent ae){
inAction.selectBySearch(mSelectBox.getText());
}
}
;
mSelectBox.addActionListener(doSearch);
mSelectBox.putClientProperty("JTextField.variant","search");
JPanel compact=new JPanel();
compact.setLayout(new BoxLayout(compact,BoxLayout.X_AXIS));
compact.setPreferredSize(new Dimension(100,24));
compact.add(mSelectBox);
return compact;
}
Project Name: jbidwatcher Package: com.jbidwatcher.ui.config
Source Code: JConfigTab.java (Click to view .java file)
Method Code:
public static void adjustField(JComponent jc,String accessibleName,DocumentListener dl){
if (jc == null) return;
jc.addMouseListener(JPasteListener.getInstance());
if (jc instanceof JTextField) {
if (dl != null) {
((JTextComponent)jc).getDocument().addDocumentListener(dl);
}
((JTextComponent)jc).setEditable(true);
}
jc.getAccessibleContext().setAccessibleName(accessibleName);
}
Project Name: jbidwatcher Package: com.jbidwatcher.ui.config
Source Code: JConfigFirewallTab.java (Click to view .java file)
Method Code:
private JPanel buildHTTPSProxyPanel(){
JPanel proxyPanel=new JPanel();
radioAction rad=new radioAction();
proxyPanel.setBorder(BorderFactory.createTitledBorder("HTTPS/Secure Proxy Settings"));
proxyPanel.setLayout(new BoxLayout(proxyPanel,BoxLayout.Y_AXIS));
httpsProxyHost=new JTextField();
httpsProxyPort=new JTextField();
setAllHTTPSStatus(false);
adjustField(httpsProxyHost,"Host name or IP address of HTTPS proxy server",firewallTextFieldListener);
adjustField(httpsProxyPort,"Port number that the HTTPS proxy server runs on",firewallTextFieldListener);
proxyHttps=new JCheckBox("Enable HTTPS (secure http) proxy?");
proxyHttps.addActionListener(rad);
JPanel checkboxPanel=new JPanel(new BorderLayout());
checkboxPanel.add(proxyHttps,BorderLayout.WEST);
proxyPanel.add(checkboxPanel);
proxyPanel.add(makeLine(new JLabel("HTTPS Host: "),httpsProxyHost));
proxyPanel.add(makeLine(new JLabel("HTTPS Port: "),httpsProxyPort));
return proxyPanel;
}