|
I'd like to know if there is an easy way to get character input from a JTextField in Java as they happen, not after an enter keystroke.
In my case I want the characters (text) to be read in, and when the enter key is hit, do something with the characters...
Started by Fred on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
"heg[backspace]llo[enter]" is somehow treated differently than....
It seems like for the task you want to do you should wait until the enter keystroke and then do what want to do it character by character, and include non-text character (i.e.
|
|
I'm writing a Java Swing application using the Metal look-and-feel. Every time there is a JButton in my application the user uses the Tab key to move the focus to the button and then hits the Enter key. Nothing happens! If he hits the Space key the button...
Started by Alfred B. Thordarson on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Button.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER....
Something like the following(KeyEvent.VK_SPACE, 0, true)); // add a mapping from enter to the same command.
You do it by assigning an input / action map for the Enter key.
|
|
Hi,
I have this strange issue with my keyboard in Solaris 10 running on VirtualBox (Windows 7 host). It works fine in the terminal and all native applications but when it comes to all Java-applications my Enter/Delete and Backspace keys does not work....
Started by Ola Herrdahl on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at superuser):
Set up a quick Java proggy to output the hex value of the input byte(s) everytime a keyboard event.
|
Ask your Facebook Friends
|
Hi
i want through Java to geocode a given place or anything similar like "Hungarian National Library, Budapest" or "úri utca, budapest". I want from these to get coordinates (geocoding).
I saw that for similar google applications like google translate...
Started by maiky on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Google provides a HTTP geocoding service which you can access with any programming language. .
This blog post seems to be what you're looking for .
|
|
I'm using the Scanner class to take some input from the user through the console. Whenever the user inputs something in the screen and presses enter the input stays on screen for example:
This is the prompt // User writes command and presses enter
command...
Started by climatewarrior on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Long answer: in Java, all console operations are handled through input and output streams for yourself, there is no ....
Java has very limited control over the console programmatically.
Short answer: no, not from directly within Java.
|
|
I encountered this problem several times. If I pack a Java application in an executable jar file that takes arguments from a user, then the user have to invoke the program (jar file) from the command prompt by the following command:
java -jar "jar-file...
Started by Yatendra Goel on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
To explain why:
There are 2 java JVM your app so that it uses Java GUI items for input and output instead of System.in/System.out.-based Java JVM (java.exe) is run....
This functionality inside your program (or with a wrapper class .
|
|
I've been working with .net since 2001, and I am considering making a move into the java space.
I find that java has so many more mature tools (hibernate is more mature, spring framework, established patters/designs, containers, distributed cache frameworks...
Started by mrblah on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
I've changed from C++ to Java to C# both ;-) but I like C# better than Java.....
If you use VB to study then I see no reason you shouldn't be able to .
If you use C# (or C++) then you should have few problems going into the Java world.
|
|
Hi,
I'm trying to make a method that returns a string of words in opposite order.
IE/ "The rain in Spain falls mostly on the" would return: "the on mostly falls Spain in rain The"
for this i am not supposed to use any built in Java classes just basic ...
Started by SaFruk on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
Concat() returns a new string to assign the return of concat to something:
stringOut=stringOut.concat(word)
Strings in Java (and .net.
They can't be changed.
In Java, Strings are immutable, i.e.
|
|
Making a simple app for my android.
in my xml interface there is a text box in which the user will input a number (for example: 10). the id of this text box is "input1"
how do I call the value of input1 in java and then perform a calculation on it?
For...
Started by Sean on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
In the Activity where you are using this layout XML, you would do this:
private EditText input; private EditText result; public void onCreate(Bundle b) { setContentView(R.layout.my_activity); // Extract the text fields from the XML layout input = (EditText... .
|
|
I am trying to throw a (custom) ImportException from the method importUsers in class UserHelper. I can see in the debugger that the throw clause is executed, but the method, from which the importUsers method is called, never catches the exception.
Here...
Started by simon on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
The line information....
If "test2" is printed, then there is no exception at all being thrown by importUsers() .
Perhaps insertUserData() doesn't throw any exception in your test setup? It would help if that method was included in your question as well.. .
|