Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT virtual onscreen keyboard project using java and swings

Have Programming Question? Ask it here!
 
 
 


shirisha
virtual onscreen keyboard project using java and swings
1 Answer(s)      5 years and 2 months ago
Posted in : Swing AWT



Advertisement
View Answers

June 24, 2009 at 5:37 PM


Hi Friend,

Try the following code:

import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.border.*;

public class SpaceKey extends JPanel implements ActionListener
{
static final String st = "ABCDE";
JButton buttonList[];
String buffer = "";
JTextField text;
JButton backspace, spaceBar;

public void key() {
text = new JTextField(20);
text.setActionCommand(""+ buffer);
add(text);
int n = st.length();
buttonList = new JButton[n];
for (int i = 0; i < n; i++) {
buttonList[i] = new JButton( "" + st.charAt(i) );
add(buttonList[i]);
buttonList[i].addActionListener(this);
}
spaceBar = new JButton("Spacebar Key");
add(spaceBar);
spaceBar.addActionListener(this);

backspace = new JButton("BackSpace Key");
add(backspace);
backspace.addActionListener(this);
}
public void actionPerformed( ActionEvent e) {
int n = st.length();
if (e.getSource() == backspace) {
buffer = buffer.substring(0,buffer.length()-1);
text.setText("" + buffer);
}
else if (e.getSource() == spaceBar){
buffer += " ";
}
else{
for (int i = 0; i < n; i++){
if (e.getSource() == buttonList[i]){
buffer += st.toLowerCase().charAt(i);
text.setText(""+ buffer);
break;
}
}
}
}
public SpaceKey(){
JPanel pane = new JPanel();
add(pane);
}
public static void main(String s[])
{
JFrame frame = new JFrame();
SpaceKey keys= new SpaceKey();
frame.getContentPane().add(keys,"Center");
keys.key();
frame.setSize(500,100);
frame.setVisible(true);
}
}

Thanks


Related Tutorials/Questions & Answers:
virtual onscreen keyboard project using java and swings - Swing AWT
virtual onscreen keyboard project using java and swings  sir thanks a lot for ur reply for my last question, can u please send me the entire project code of virtual on screen keyboard.i did but im not sure as it was right
virtual onscreen keyboard project using java and swings - Swing AWT
virtual onscreen keyboard project using java and swings  Im doing virtual on screen keyboard as my project. i didnt get the method to performthe backspace and space operation using swings in java.can please help me  Hi
Advertisements
virtual on screen keyboard project - Swing AWT
virtual on screen keyboard project  Hi im doing my project work on virtual onscreen keyboard. i want the code for key function of shift and capslock.please send me the code   Hi Friend, For CapsLock key,try
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA... i start Virtual Keyboard, Means ,if 1st time Button1=''a'' then next login time... Distribution & Counter...? ? ? . . Try to Give me Solution..in JAVA if its
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA or Net Beans ???
How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA... i start Virtual Keyboard, Means ,if 1st time Button1=''a'' then next login time... Distribution & Counter...? ? ? . . Try to Give me Solution..in JAVA if its
How to display windows virtual keyboard
How to display windows virtual keyboard  Hi, I have a jsp file which contains my website design. In my jsp website design, there's a button. I need to display windows virtual keyboard when i press the button. how to do
java code using swings
java code using swings  code that should be able to enter data of student details using all swings into the access database using jdbc connectivity
write a java pogram to add elements to linked list using keyboard and display it
write a java pogram to add elements to linked list using keyboard and display it  write a java pogram to add elements to linked list using keyboard and display
want a program for date picker by using java swings
want a program for date picker by using java swings  to write a program for the date picker by using java swings.any one please help me by providing the code to this java date picker by using the java swings.previously a program
java keyboard shortcuts - Struts
java keyboard shortcuts  hi, i hav an application already developed using struts framework.now i would like to add some keboard shortcuts to my application, so that the user need not to go for the usage of the mouse every time
Java Virtual Machine
Java Virtual Machine  What is Java Virtual Machine? Are JVM different for each OS? Thanks   Hello, JVM or Java Virtual Machine is run... more at Java Virtual Machine Technology. Thanks
java virtual machine
java virtual machine  please give some detail about JVM
How to Create Keyboard in JAVA
How to Create Keyboard in JAVA  please help me to create On-Screen Keyboard with java and please give me an another idia to make it ..............iam waiting for your help ,think u so much
disable keyboard in java applet
disable keyboard in java applet  How to disable key board of my client in an java applet embedded in a website while the applet is running.? Plz help
core java project by using databse
core java project by using databse  hello sir, i'm a b.tech final year student.... i wantto make a project on java with database... can u plzz suggest me how i can start for it.... means on which topic i can make project
Virtual Fuction invokation in java
is virtual method in java?Please explain...Virtual Fuction invokation in java  Please help me. If i have create a Employee class,which is the super class of Manager. And I create an object
Virtual Fuction invokation in java
is virtual method in java?Please explain...Virtual Fuction invokation in java  Please help me. If i have create a Employee class,which is the super class of Manager. And I create an object
Java Virtual Machine Technology
Java Virtual Machine Technology Java development kit termed as  JDK have more than one implementation of the JVM. Java HotSpot Client VM also termed.... This is the Virtual machine implementation comes with JDK.It is basically designed to cut
Java Swings
Java Swings  I am doing one project on java Swings, in this i have created one jframe where i defined some JButtons and Jcombobox's, here i need to insert one JTable with headers(IN CURRENT JFrame only).pls help me urgently
Image Movement using Swings
Image Movement using Swings  How to move image using Swings
An application using swings and vector methods
An application using swings and vector methods   Hi, I want an application in Java swings which uses good selection of Vectors methods
making of dynamic textfields using swings
making of dynamic textfields using swings  How to make dynamic textfields using java swings
Java Virtual Machine
Java: Java Virtual Machine After you read this section, you should be able... different machines. The key to Java's portability and security is the Java Virtual Machine. The Java Virtual Machine Most compilers translate from the source
Java Virtual Machine
Java Virtual Machine The Java Virtual Machine is a software package that comes... on Linux and vice versa. JVM - Execution Environment JVM or Java Virtual Machine... independence by using the network byte order in Java class files So, JVM
Non-virtual Methods in Java - java tutorials
: #000000; } Non Virtual Methods in Java Lets see the concept of virtual... hierarchy. In Java programming language all the methods are virtual, i.e.... The better way to achieve the non-virtual function in java is that make all
how to use marathi keyboard in java programming?
how to use marathi keyboard in java programming?  how to use Marathi keyboard in java programming
Project on mailing system using Java/JSP
Project on mailing system using Java/JSP  I am making a project on mailing system in Java/JSP. How could I display the inbox messages on the home page of user? Please tell me about how to handle these messages in database
how to store data in table using swings - Java Beginners
how to store data in table using swings  Hi, I am doing a project in which i need to store some data in the table using swings.......Iam using... , whether do i have any option in swings to increase my output look (my target
java swings - Swing AWT
java swings  I am doing a project for my company. I need a to show the performance of the employees by using bar bharts. Please give me how can we write the code for bar charts using java swings.  Hi friend, I am
Looking for sample project in java using netbeans
Looking for sample project in java using netbeans  Hi all, i am novice in developing desktop application in java using netbeans. can anyone pls help me by sending project built in netbeans as soon as possible. so that i could
Java Virtual Machine
Java Virtual Machine       In this section, you will learn about the java virtual machine (JVM) and how to work? Java Virtual Machine (JVM) Java Virtual Machine is a set of computer
java swings - Java Beginners
java swings   Do you want to add textfields on the JPanel
how can i draw a table using applet or swings - Java Beginners
how can i draw a table using applet or swings  Hi RoseIndia, Actually, I was trying for creating a table using applet or swings.......... My task is create a table and enter the integer values during run time......I have
write a program to remove the element from hashset using keyboard.
write a program to remove the element from hashset using keyboard.  write a program to remove the element from hashset using keyboard
another frame by using awt or swings
another frame by using awt or swings  how to connect one frame to another frame by using awt or swings
Java Virtual Machine Free Download
Java Virtual Machine Free Download       The Java Virtual Machine is required to run your java program in your computer. The Java Virtual Machine software is freely downloadable from
about swings - Java Beginners
about swings   Dear sir,Good evening, i am doing mca sir,i am doing the project in swings,so plz provide the material about swings sir...: http://www.roseindia.net/java/example/java/swing/ Hope
online test project on java using servlets and jsp
online test project on java using servlets and jsp  as i am doing online test project on java using jsp and servlets ,,,the problem is in the code of jsp file which i have sent,...,i used next and previous buttons and used two
Java Virtual Machine Free Download
Java Virtual Machine Free Download       Java Virtual Machine Free Download The Java Virtual Machine is required to run your java program in your computer. The Java Virtual
java swings
java swings  how can we use the shared locks of dbms in java? I am working on a mini project which is based on the eamcet councilling .i am struck with a problem where if a student select a college and a branch and sees
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
How can i draw a line using java swings
How can i draw a line using java swings  Sir my program contains different components i am using JFrame. I want to draw a straight line between components(Jtextfeilds, Jlabels).So could you help me for it. Thank You
java swings
java swings  Hi, I have one class file using three panel methods,the three methods is used for three tabs.then how can i set the background image.Please send the sample code for me. I already posted two questions,but i didnt get
java swings
java swings  Hi, I need the sample code for how to set the background image using jframe and also set the jtext field and jlable boxes under the bachground image. Please send the code immediately,its very urgent.Please send me
java swings - Java Beginners
java swings   Hi, I need the code for click the refresh button then list values will be refresh.Please send the code ........... Thanks, Valarmathi
java swings
java swings  hi... I am having multiple swing forms.. when i click on a button another form is going to opening but it is opening as different form... Now i want it to be open dynamically instead separately.... Is there any
java swings
java swings  Hi, I need a sample code for once click the exit tab the frame window will be closed. Instead of button close i need tab close option.Please send the sample code immediately.......?Its very urgent........ Thanks
virtual on screen keyboar - Swing AWT
virtual on screen keyboar  sir i need shift key operation code in my project program of virtual keyboard can uplz send
virtual function
virtual function  Explain virtual functions in Java
java swings - JavaMail
java swings  Hi sir,i am doing a project on swings,i don't have any knowledge about the layoutmanagers,so my project is very very burden to me,so plz...://www.roseindia.net/java/example/java/swing/GrideComponents.shtml http
Advertisements
 

 

 

DMCA.com