Moving cursor to another TextField & Max. Frame.
Hi All.
I have 2 questions reffer to the following code.
1. How to move cursor from tffirstname to tflastname, tfaddress and tfphone
with use Enter key press on the keyboard?
2. At the first run time i want the form size automatically have a Maximum
Window, how to do it?
Thank a lot.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class DataInput01
JFrame frm = new JFrame("Input Personal Data");
Container pane;
JLabel lbfirstname,
lblastname,
lbaddress,
lbphone;
JTextField tffirstname,
tflastname,
tfaddress,
tfphone;
JButton btok,
btcancel;
public DataInput01()
lbfirstname = new JLabel("First Name :");
lblastname = new JLabel("Last Name :");
lbaddress = new JLabel("Address :");
lbphone = new JLabel("Phone :");
tffirstname = new JTextField(15);
tflastname = new JTextField(15);
tfaddress = new JTextField(15);
tfphone = new JTextField(15);
btok = new JButton("Submit");
btcancel = new JButton("Go Home");
pane = frm.getContentPane();
pane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
pane.add(lbfirstname);
pane.add(tffirstname);
pane.add(lblastname);
pane.add(tflastname);
pane.add(lbaddress);
pane.add(tfaddress);
pane.add(lbphone);
pane.add(tfphone);
pane.add(btok);
pane.add(btcancel);
frm.setBounds(0, 0, 280, 200);
frm.setResizable(false);
frm.setContentPane(pane);
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
btcancel.addActionListener(new ActionListener()
{ public void actionPerformed(ActionEvent e)
{ System.exit(0);}
public static void main(String args[])
new DataInput01();
}
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class DataInput01
JFrame frm = new JFrame("Input Personal Data");
Container pane;
JLabel lbfirstname,
lblastname,
lbaddress,
lbphone;
JTextField tffirstname,
tflastname,
tfaddress,
tfphone;
JButton btok,
btcancel;
public DataInput01()
lbfirstname = new JLabel("First Name :");
lblastname = new JLabel("Last Name :");
lbaddress = new JLabel("Address :");
lbphone = new JLabel("Phone :");
tffirstname = new JTextField(15);
tflastname = new JTextField(15);
tfaddress = new JTextField(15);
tfphone = new JTextField(15);
btok = new JButton("Submit");
btcancel = new JButton("Go Home");
pane = frm.getContentPane();
pane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
pane.add(lbfirstname);
pane.add(tffirstname);
pane.add(lblastname);
pane.add(tflastname);
pane.add(lbaddress);
pane.add(tfaddress);
pane.add(lbphone);
pane.add(tfphone);
pane.add(btok);
pane.add(btcancel);
//changes
java.util.Set forwardKeys = new java.util.HashSet();
forwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,0));
forwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
pane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,forwardKeys);
//frm.setBounds(0, 0, 280, 200);
frm.setExtendedState(JFrame.MAXIMIZED_BOTH);
//frm.setResizable(false);
//end changes
frm.setContentPane(pane);
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
btcancel.addActionListener(new ActionListener()
{ public void actionPerformed(ActionEvent e)
{ System.exit(0);}
public static void main(String args[])
new DataInput01();
}
Similar Messages
-
Mouse cursor moving mask over another image.
Hi, Is it possible to have where the Mouse cursor is on the page moving mask over another image. Imagine a black screen with a star cut out of the middle(where the cursor is) and u can see the image behind.
Any examples on how to do this?
Can it be done in html instead?Create the mask and the background as movieclips and then assign the mask as the mask property of the bacground movieclip... as in background.mask = msk (where msk is the instance name of the mask).
Then assign a MOUSE_MOVE event listener to the mask and in the event handler for that listener have its x and y properties assigned to be the mouseX and mouseY properties -
Copying value from one cursor to another
Hi,
I have a problem while copying values from one cursor to another cursor.
The code looks like below.
PROCEDURE XYZ
TransactionResultSet OUT NOCOPY types.ref_cursor,
IS
temp_cursor types.ref_cursor;
wip_rec types.ref_cursor;
BEGIN
DECLARE
CURSOR temp_cursor IS
SELECT ...........
END;
BEGIN
FOR wip_rec IN temp_cursor
LOOP
update tinsagr set something
where {the condition}
IF SQL%ROWCOUNT = 0 THEN
dbms_output.put_line('this is test ');
Fetch wip_rec into TransactionResultSet;
END IF;
END LOOP;so basically i want to iterate the "temp_cursor" and depending on the values i get it from here i shall update a table. Actually i want to exclude few records from "temp_cursor" and add it/copy rest of the records to "TransactionResultSet"
That means say initially " temp_cursor" has 100 records and i updated 5 records in a table and same number of records should be excluded and rest should be added to the output cursor TransactionResultSet.
How do i achieve it?
while saving i am getting
(1): PLS-00456: item 'WIP_REC' is not a cursor.
Do any one has any idea what to do in such scenario?There are options like....
SQL> CREATE OR REPLACE TYPE emp_obj AS OBJECT (ename VARCHAR2(50), dept NUMBER);
2 /
Type created.
SQL> CREATE OR REPLACE TYPE emp_tbl IS TABLE OF emp_obj;
2 /
Type created.
SQL> set serverou on
SP2-0158: unknown SET option "serverou"
SQL> set serverout on
SQL> DECLARE
2 rc sys_refcursor;
3 v_ename emp.ename%TYPE;
4 v_dept emp.deptno%TYPE;
5 ---End Of Local Varriable Declaration
6 --Procedire declaration !
7 PROCEDURE TEST_CUR(pi_out_ref_cur IN OUT sys_refcursor) IS
8 emp_rec emp_tbl;
9 BEGIN
10 /* This BULK COLLECT can be done with explicit cursor,Ref Cursor
11 with some simple modification, Here I have used implicit cursor! */
12 SELECT emp_obj(ename, deptno) --Casting as the object
13 BULK COLLECT
14 INTO emp_rec
15 FROM emp
16 WHERE deptno = 10;
17
18 dbms_output.put_line('Records selected are:');
19 FOR i in 1 .. emp_rec.COUNT LOOP
20 dbms_output.put_line(emp_rec(i).ename || '--' || emp_rec(i).dept);
21 END LOOP;
22 --Now we are filtering the record and may be doing some operation with each record.
23 FOR i in 1 .. emp_rec.COUNT LOOP
24 IF emp_rec(i).ename = 'KING' THEN
25 --You can change this IF according to your need.
26 emp_rec.DELETE(i);
27 END IF;
28 END LOOP;
29 OPEN pi_out_ref_cur FOR
30 SELECT * FROM TABLE(emp_rec); --Using the TYPE AS table.
31 END TEST_CUR;
32 /* Main execution or procedure calling section*/
33 BEGIN
34 --Actual calling
35 TEST_CUR(rc);
36 dbms_output.new_line;
37 dbms_output.put_line('Now in Ref Cursor');
38 dbms_output.put_line('****************');
39 LOOP
40 FETCH rc
41 INTO v_ename, v_dept;
42 dbms_output.put_line(v_ename || '--' || v_dept);
43 EXIT WHEN rc%NOTFOUND;
44 END LOOP;
45
46 END;
47 /
Records selected are:
CLARK--10
KING--10
MILLER--10
Now in Ref Cursor
CLARK--10
MILLER--10
MILLER--10
PL/SQL procedure successfully completed.
SQL> -
ghlighting a file and then moving cursor over a file lower in the list, and pressing shift-control-click. I can't do that in now with Mac Pro. What am I doing wrong?
Holding down the control key will invoke "right-click."
Depending on the View, holding down Shift will with either toggle the selection (Icon View), or it will make a continuous selection from the previous selection (List View or Column View).
The only way to make a continuous selection in Icon View is to drag out a selection marquee around or through the icons.
I can't remember the behavior of previous OS's. -
Using a Cursor in another cursor
Hi Guys,
I have declared a cursor in one of my program unit in forms 6i form, like this:
Declare
Cursor C1 is select employee_id, emp_name from employees;
Begin
End;
Now i have to declare an other cursor that will be using the employee_id of the cursor C1.
for example :
Declare
Cursor C1 is select employee_id, emp_name from employees;
Cursor C2 is select C1.Employee_id, Employees.Age
from C1, employees;
Begin
End;
I dont think we can do this.... as it gives error in forms. What is the alternate how can i reference a cursor in another cursor??
Kindly Help Pliz, Imran BaigImran,
you can do this. The way you try to read from a cursor is not correct because you treat a cursor like a table which it isn't. You have to loop through the parent cursor and then within this loop, loop the second cursor. Please see the PLSQL documentation on OTN on how to do this (its not that big of a deal).
Frank -
What is the max frame rate in depthFrame
In v1.8, I remembered the frame rate can be up to 30fps in depthFrme. what is the max frame rate in depthFrame in the v2.0? And how can i set it? thx!
Depth (and IR, body, face and HDface) frame rates are 30fps.
Color is 30fps unless low light mode is detected then it automatically switches to 15fps.
If you're using the multistream source it will stream at the lowest framerate from the chosen framesources.
When you're using separate sources they all stream at their own fps rate.
Frame rates can not be set by the user.
Brekel -
Error after moving user to another organiz.l unit (Edir)
I am moving users to another org. units.
For 2 users, i keeep seeing the following error in /var/log/datasync/connectors/default.pipeline1.mobility-AppInterface.log:
ERROR [Device_Thread-29] [sync:252] [userID:cn=**,ou=**,o=**] [eventID:] [objectID:] [Sync] Fatal - unable to find folder object for folderId = 2
Any idea?If you are moving users around OUs/Orgs then you will need to remove them from the connector, wait for them to vanish, move user in eDirectory, re-add to connector. As far as I'm aware this is a limitation in all Datasync connectors that link to eDirectory.
-
Problem: do something, if jumping in another textfield through tab-key
hi,
please, maybe can anybody help me.....
I've got some textfields (JTextField) in a swing-application. by jumping in another textfield through pressing the tab-key, something should happen.
I wrote the following code, but it doesn't works ;-(
textfieldReleaseOf.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_TAB ) {
System.out.println("tabspr...................");
else {
System.out.println("kein tabspr...................");
thanks for helping......From your problem description it seems that you need to do something not only when the user presses TAB but also if the user switches to some other textfield. Although it could be accomplished using the KeyListener as you have already done, a better way would be to use the FocusListener. You can add a FocusListener to your JComponent (or JTextField) object. It will fire events whenever the user presses tab to move onto the next field and even when the user clicks on the next field using a mouse.
-
I'm trying to set the value of a textfield to a instance of another textfield in a repeating subform
Hello all,
I am trying set the value of a textfield in a repeating subform/table row to another textfield in a repeating subform with the corrosponding instance number.
The user enters a list of Key Activities in the first part: -- KeyActivityRow is the repeating subform --
xfa.resolveNode("form1.#subform.KeyActivities.Row1.Table2.KeyActivityRow.Cell2")
-- KeyActivityRow is the repeating subform --
Which then Populates the corresponding occurence of: --
xfa.resolveNode("form1.#subform.ActivityTable.HeaderRow.Table1.HeaderRow.Cell1")
-- ActivityTable is the repeating subform --
KevinIn the calculate event of form1.#subform.ActivityTable.HeaderRow.Table1.HeaderR ow.Cell1 enter this script in Language:JavaScript :
this.rawValue=xfa.resolveNode("form1.#subform.KeyActivities.Row1.Table2.KeyActivityRow["+A ctivityTable.index+"].Cell2").rawValue
Kyle -
Moved Masters to another Project, Icons not visible
Greetings,
In aperture I moved masters to another project. Looking into the new project several icons don't show (greyed) the photos.
Anyone know how to undo or get them visible again?
Thanks!
Left one is visible, right one greyed-out (2 different photos). I can open the greyed-out photo though but browsing is a hassle, opening the greyd-out photos to see what it is every time.I can open the greyed-out photo though but browsing is a hassle, opening the greyd-out photos to see what it is every time.
This looks like the thumbnails cannot be read. Try to recreate the thumbnails for the project:
Select the photos, and from Aperture's main menu bar use:
Photos > Generate Thumbnails.
Does that bring the thumbnails back? If not, check, if the backup of your Aperture library is current, back up, if necessary, and run the Aperture Library First Aid tools to repair the permissions, the database, and if necessary rebuild the library.
Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual
Regards
Leonie -
Moved itunes to another disk now everything is gone
ok so my (C) disk was low on space, so I went to iTunes, and moved itunes to another drive. after I went throught that whole process, I copyed the iTunes folder from the (c) drive to the (d) drive (the new drive) and then after it had finished pasting, I deleted the iTunes folder from the original drive. I then opened itunes and it now is empty what do I do in order to get everything back? thankyou in advance.
annaliesebieberninjaaah wrote:
ok so my (C) disk was low on space, so I went to iTunes, and moved itunes to another drive. after I went throught that whole process, I copyed the iTunes folder from the (c) drive to the (d) drive (the new drive)
I'm confused.
You moved iTunes to another drive and then then you copied the iTunes folder to the D: drive?
How did you first move iTunes to another drive?
Then why did you copy the iTunes folder after that? Isn't this moving iTunes to another drive"
Hold Shift and launch iTunes.
Select Choose library... and select the iTunes folder you copied to the other drive. -
Move cursor position in TextField
hi all
I am creating a keyboard in flash. i want to move cursor
position in TextField to insert new character, if anybody knows
plese mail me.
thanks in advanceHey thanks v.seregin but i used an entirely different approach.
Here is my application where i m trying to move pen in input text box
This is an application in facebook please give any suggestions etc..
http://apps.facebook.com/linc-mydiary/
hey thanks to all people who solve our problems. -
Moving MAIL to another internal hard drive?
I'm out of room on my start-up drive, and I have been considering moving the apple MAIL program off of the main start-up drive and onto one of my other internal hard drives. (I get the impression MAIL and all the eMail & stuff stored with it takes up a LOT of space!)
can anyone tell me what the steps would be in moving MAIL to another hard drive?
Thanks!
wWhat else is on your boot drive? Move that to a data drive first and always (music, photo, video, etc) all your user data.
Then consider moving the home folder to another drive, very easy from the User control panel (use to be Accounts).
Move the system to an SSD or SSD-PCIe
Put "user account" on its own drive (SSD maybe as well)
A data drive. 4TB drives are fast and more affordable.
PCIe so you aren't using the 4 drive bays and can do SATA III and faster (SSD devices that are faster than a pair of SSDs)
Create a lean system boot drive with only OS and apps. -
T60p - arrow keys "shift" screen side to side instead of moving cursor
T60p running WinXP - arrow keys "shift" screen side to side instead of moving cursor ; happens in Notes and Excel.
How do I reset to "normal"?Try to turn off scroll lock (key named "ScrLk")
-gan -
I need to know how I can move the cursor to a textfield when my application starts. Does anybody know how I can do this??
Take a look at this thread:
http://forum.java.sun.com/thread.jsp?forum=57&thread=290339
Maybe you are looking for
-
How do I print from an Android device using bluetooth?
You had purchased the Officejet Mobile 100 printer to print from your Android device using bluetooth. You have the devices paired with bluetooth, but do not see an option to print or the print button does not work in this case. Well, here is how this
-
How to get the short text values from F4 SEARCH HELP
Hi Friends, My requirement is in Module -pool Screen Programming, i have Designed one field in a custom screen and provided a F4 search help to that field.. For eg the F4 help is displayed as below. Value short text 1
-
Hello, I'm creating a PDF with CFDOCUMENT and CFPDF and I have two questions 1. I'm trying to insert an image with the following code: <cfdocument name="cover" format="pdf"> <img src=" http://www.domain.com/image.jpg"> </cfdocument> <cfPDF action="wr
-
"An error occurred loading this content....try again later" ERROR
I have Apple TV 3 which is connected with Wi-fi. I updated its software to the latest one and after that, I started to get "An error occurred loading this content....try again later" error sometimes. I could not find a specific situation so far. I ha
-
I recently purchased the Dell XPS 15 as it is configured with the massive power needed to use photoshop and Lightroom. However, it seems that the screen is not compatible and it is unresolvable. I am SOOOOOO disappointed, and now it is Dell's prob