• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Making remote event?  RSS feed

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends...

I have a question..
is there any way to making a remote event in Java Swing?..
example..
i want to access the static JTextField's keyReleased event ..
or assume that i want to send keyCode (Enter) to that JTextField..
is it possible?..

Thanks in advance..

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the simple way of doing what I think you're trying to do
is to move the textField's keyReleased code into a separate method

e.g.


now you can call doSomething() from elsewhere in your program
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sir for your reply..

Sir.. i found a bit problem for handling the numeric input in textfield..
Could you give me any advice?..

i want to restrict only numeric input in JTextField..
i have written code like this instance

That code written in txtTotal's KeyReleased Event

but i feel dissatisfied about that code..
when i clicked left, right, up, down, backspace, or another character, the txtTotal value would be empty..

is there any a better way to handle it?..

Thanks in advance..
Sorry for the really basic question..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Maneesh
Thanks for your reply..

but i uses netbeans 6.0.1..
how to use it in netbeans 6.0.1?..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you learning Java or Netbeans?

I have never used Netbeans myself, but I am sure there will be a "code" view. Switch to that view and modify your code. Stop using the DND and "property" feature. Hand coding is always best.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Are you learning Java or Netbeans?



Actually, I learning Java by Using Netbeans..

Yap, but i couldn't do it in Netbeans..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Carreira wrote:Yap, but i couldn't do it in Netbeans..


There is no "code" view in Netbeans, where you can modify the code?
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nope..

In Fact, There is any source code view in Netbeans..
but all of the components are generated by drag and drop into JFrame and JDialog..

in your example that you have gave to me, the component generated by a "code"..
and its really hard for me to add that component to my JFrame..

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found this
http://wiki.netbeans.org/Java_EditorUsersGuide
Looks like you can switch to code view using Navigate->Go to source (Alt-O).
Sorry. Cannot help you beyond this for Netbeans. Like I said, I never used it.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay.. its nevermind sir..

i just a newbie in Java, i have to learn extra extra hard to be a Java Expert..
Thanks for that link..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Carreira wrote:Okay.. its nevermind sir..


Please stop it. I am not a knight
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!