Re: Document Filtering Question



On May 28, 9:29 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
This won't handle backspace and there are other issues but this does
what you said you wanted.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class test9 {
     public static void main(String[] args) {
         EventQueue.invokeLater(new Runnable() {
             public void run() {
                 JFrame f = new JFrame();
                 f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

                 JTextField tf = new JTextField(30);
                 tf.addKeyListener(new KeyAdapter() {
                     public void keyTyped(KeyEvent ke) {
                         System.out.print(ke.getKeyChar());
                         ke.consume();
                     }
                 });

                 f.add(tf,BorderLayout.CENTER);
                 f.pack();
                 f.setVisible(true);
             }
         });
     }

}

What is the actual purpose of this?

--

Knute Johnson
email s/knute/nospam/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
      ------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

Wow. Yea that does exactly what has been stumping me for a week. I
really cannot thank you enough. This is a small piece of an
application I am writing for an existing financial project Im trying
to build (not for a fee, for my business). If you wouldnt mind
answering one last question, how long have you been writing Java to
put this together so fast (and clean)?
Thank you again very much.

Chris
.



Relevant Pages

  • Re: Coordinating multiple JTextField updates across panels
    ... Knute Johnson wrote: ... I don't really know how the drawing coalesces in a situation like this but I would imagine if the setTextcalls took long enough, it wouldn't coalesce all of the drawing into one call. ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.gui)
  • Re: How to persist print dialog settings?
    ... Knute Johnson wrote: ... and am having trouble getting the application to retain the settings ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.programmer)
  • Re: thread-safe graphics access
    ... Knute Johnson wrote: ... The other thing I meant to say and pressed the button too fast on was that in recent history I've been working on trying to get the smoothest animation possible. ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.gui)
  • Re: thread-safe graphics access
    ... Knute Johnson wrote: ... This was a Windows, DirectX, and my nvidia card problem only. ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ...
    (comp.lang.java.gui)
  • Re: Aqualunging?
    ... Posted via NewsDemon.com - Premium Uncensored Newsgroup Service ... Unlimited Access, Anonymous Accounts, Uncensored Broadband Access ... Country, I suppose. ... Actually I play in a few different venues. ...
    (rec.boats)