How to lock commandlistener for certain time (to ignore buttons whie next )
Hello,
I have a following (perhaps trivial) problem: I have a couple of methods which creates next screens in my app (meth1()...meth2()..meth3()). I have an "next" button, which swiches me between screens. Between switching to next screen I'm doing some gprs connection (in commandAction(Command c,Displayable c )) whitch take some time. Now, when user pushes my "ok" button couple of times, the commandlisteners works for all of them and when the gprs conn ends it puts mi two screens away. How can I lock input until next 'screen'(method) is invoked?Here's my sample code:
public void myScreen1(){
currentMenu="myscr1";
Form f=new Form("Screen1 ");
DateField godzPoczatkowa=...
f.append(godzPoczatkowa);
f.addCommand(backCommand);
f.addCommand(okCommand);
f.setCommandListener(this);
myDisplay.setCurrent(f);
public void myScreen2(){
currentMenu="myscr2";
Form f=new Form("Screen2 ");
StringItem str=...
f.append(str);
f.addCommand(backCommand);
f.addCommand(okCommand);
f.setCommandListener(this);
myDisplay.setCurrent(f);
public void myScreen3(){...}
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("Ok")&?tMenu.equals("myscr1")){
//gprs connection which locks app for couple of secconds
myScreen2();
}else if(label.equals("Ok")&?tMenu.equals("myscr2")){
myScreen3();
}else if(....myscr3)Hope U can help,It's pretty urgent for me.Thanks in advance
Hi,
Use a boolean variable as a flag which will be true when the connection is taking place. and in the commandAction method if the flag is true just say return. else the event will be processed.
Similar Messages
-
Export tables for certain time frame
Hi All,
Can I export tables for certain time frame? Or from last time I exported those tables? All I want is to have all the changs of the tables from last time I did export, then I can import this delta portion into another instance, thus complete the data replication.
Thanks,
Mikeuser550903 wrote:
Hi All,
Can I export tables for certain time frame? Or from last time I exported those tables? All I want is to have all the changs of the tables from last time I did export, then I can import this delta portion into another instance, thus complete the data replication.
Thanks,
Mikehow would export determine which are the new rows?
how would export determine which rows have been updated? -
How to disable iMessage for certain contacts
I was wondering how to disable iMessage for certain contacts!
Try deleting the phone number from the persons contact and then re-entering it as a new number.
You don't have to delete the entire contact.
Worked for me. -
Need some help in making a label disappear for certain time
hi
i need to make a program for my java class
this is the question
Design and implement a memory game. In this game you show the user a sequence of
random integer numbers in the range of 0 to 99, and then ask him to type these
numbers. Display how many he has remembered as a score. The level of game depends
on how many numbers are there in the sequence. The duration of the display for the
sequence is the speed. The user can adjust the level and the speed.
my question is how to view the numbers for the game and make them disappear after certain time
in need help with the syntax for it
this is what i made so far
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.FlowLayout;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.*;
import java.io.*;
import javax.swing.*;
import java.awt.*;
class game extends JFrame implements ActionListener {
public static final int WIDTH = 500;
public static final int HEIGHT = 300;
public static final int x = 3;
public static final int y = 3000;
public static void main(String[] args) {
game gui = new game( );
gui.setVisible(true);
public game( )
super("MEMORY GAME");
setSize(WIDTH, HEIGHT);
setDefaultCloseOperation(JFrame.EXIT_ON_
setLayout(new BorderLayout( ));
JPanel buttonPanel = new JPanel( );
buttonPanel.setBackground(Color.LIGHT_GR
buttonPanel.setLayout(new FlowLayout( ));
JButton b1 = new JButton("MAKE IT HAREDER!!!");
b1.addActionListener(this);
buttonPanel.add(b1);
JButton b2 = new JButton("MAKE IT FASTER!!!");
b2.addActionListener(this);
buttonPanel.add(b2);
add(buttonPanel, BorderLayout.SOUTH);
public void actionPerformed(ActionEvent e)
String buttonString = e.getActionCommand( );
if (buttonString.equals("MAKE IT HAREDER!!!"))
else if (buttonString.equals("MAKE IT FASTER!!!"))
}To post code, use the code tags -- [code]Your Code[/code] will display asYour CodeOr use the code button above the editing area and paste your code between the {code}{code} tags it generates.
I strongly suggest you forget about the GUI part and first make a console application that fulfils the game specifications. If you have problems with this, you can post your questions in the New to Java section of these forums.
db -
Identify/expire Pages that have not been accessed for certain time
Hi,
I would like to create a publishing portal. Many users are able to create pages. I have the requirement that if a page does not get accessed for a certain time-period - it should be flagged for deletion and the creator should be notified by email.
Expiration policies depend on creation/modification date. Does this work for the last-accessed time (whereever I get this information from) aswell?
SvenUse below powershell
$outputPath = Read-Host “Outputpath (e.g. C:\output\UnusedSites.txt)”
$lastDate=Read-Host “Last Accessed Date (in format mm/dd/yyyy)”
$gc = Start-SPAssignment
$site=$gc | get-spsite -Identity https://sitecollectionUrl
foreach($web in $site.AllWebs)
if ($web.LastItemModifiedDate -lt $lastDate)
Write-Host -f Red “Site is old…” + $Web.Title
Add-Content -Path $outputPath -Value “$($web.Title),$($web.ServerRelativeUrl),
$($web.LastItemModifiedDate),$($web.Author)”
else
Write-Host -f Green “Site: [" + $web.Title + "] Last Modified Date: ” + $web.LastItemModifiedDate
Stop-SPAssignment $gc
Or
plan to use this tool
http://www.harepoint.com/Products/HarePointAnalyticsForSharepoint/FindOutdatedContentInSharePoint.aspx -
How to copy data for certain member from one dimension to another dimension
Dear ,
I want to copy data for certain member ("511102") from one dimension to another combinations of dimensions ,
I have the following combinations for "511102" :
_("Budget2012","FY12","Working.V01","SAR","BegBalance","1011","G_10","custom Grades")_
I want to copy "511102" to "salary"
-salary have the following dimensions :
_("Budget2012","FY12","Working.V01","SAR","BegBalance","General group","All grades","General Employees")_
, I don't know if I could do it by datacopy of cross dimensional , But I don't HOW >>>
Thanks in advanceFIX("Budget2012","FY12","Working.V01","SAR","BegBalance","General group","All grades","General Employees")
"salary"="511102"->"1011"->"G_10"->"custom Grades";
ENDFIX
or
FIX("Budget2012","FY12","Working.V01","SAR","BegBalance")
DATACOPY "511102"->"1011"->"G_10"->"custom Grades" to "salary"->"General group"->"All grades"->"General Employees";
ENDFIX
Key thing in datacopy is to place the dimensions in cross dimension in the same order. Both sides (before and after "TO") should have equal number of dimension members specified.
Cheers,
Alp -
Automatic logout after lock screen for long time?
When I leave my mac screen locked for long time, sometimes I see the following message after unlocking screen:
"Logout has timed out because the application [x] failed to quit...."
Where [x] is some application trying to quit, and is waiting for user confirmation. This happens even when the computer is plugged in to AC. Has anyone else seen this problem? TIAFound it:
http://www.askdavetaylor.com/canmac_automatically_log_out_user_afterinactivity.html
D'uh -
HT203585 How to activate microphone for face time calling? Its iPhone 4S.
Hi all>
Good day.
How to activate built-in microphone for face time calling?
ts iPhone 4S.See this article, if your mic is working, suggest restarting your device...If your voice is too faint or sounds unclear using iPhone, or iPod touch - Apple Support
-
How to update at a certain time
I have an iMac OS X Yosemite 10.10.3 and I would like to know if anyone can help me to set my updates to start at a certain time, thanks, Craig 147
AFAIK OS X does not offer that capability. You could write a script or use Automator to do this, however you are pretty much on your own to program either solution.
You can change System Preferences to check for updates daily or weekly however no specific time can be programed. -
Hi all,
I've got a new database 11G, I've not used flashback before, but my retention time is a day...I have a time that the developer did a massive update to a table to corrupt it.
How do I find the SCN for that time so I can attempt to flashback that table?
Thank you,
cayenneThank you..I also found this works:
SQL> select timestamp_to_scn(to_timestamp('20140103152000','YYYYMMDDHH24MISS')) scn from dual;
SCN
98344246
Well that might NOT work all of the time. But that is just what Oracle does when you give it a timestamp to flashback to: it converts the timestamp to an SCN and then restores data based on that SCN.
See Flashback Table in the SQL Language doc
http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9012.htm
TO TIMESTAMP Clause
Specify a timestamp value corresponding to the point in time to which you want to return the table. The expr must evaluate to a valid timestamp in the past. The table will be flashed back to a time within approximately 3 seconds of the specified timestamp.
That 'approximately 3 seconds' accuracy is due to that conversion to SCN - Oracle uses its internal table.
SCN is accurate if you know it but you usually don't.
Read, and heed, these warnings in the advanced app dev guide
http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_flashback.htm
Guidelines for Oracle Flashback Query
If a possible 3-second error (maximum) is important to Oracle Flashback Query in your application, use an SCN instead of a timestamp. See General Guidelines for Oracle Flashback Technology.
General Guidelines for Oracle Flashback Table
To query past data at a precise time, use an SCN. If you use a timestamp, the actual time queried might be up to 3 seconds earlier than the time you specify. Oracle Database uses SCNs internally and maps them to timestamps at a granularity of 3 seconds.
For example, suppose that the SCN values 1000 and 1005 are mapped to the timestamps 8:41 AM and 8:46 AM, respectively. A query for a time between 8:41:00 and 8:45:59 AM is mapped to SCN 1000; an Oracle Flashback Query for 8:46 AM is mapped to SCN 1005.
Due to this time-to-SCN mapping, if you specify a time that is slightly after a DDL operation (such as a table creation) Oracle Database might use an SCN that is just before the DDL operation, causing error ORA-1466. -
TS3992 How to lock screen for backup?
I need to know how to lock my screen for backing up my phone to iCloud
To avoid rotation?
Press the Home button twice then swipe left to right then tap the rotation icon. -
Do sth for 5 sec. or 5 min.? How does Java wait for some time ?
How can I show a text in a label for 5 sec. and then make it disappear ?
How can I make my app wait for some time ?
What's the command ?
thanx!The above is correct, but since painting is done in a separate thread, the likely result would be a blank space for 5 seconds, followed by a brief flash of text. You need to look at methods like invokeLater in SwingUtilities. You could also try forcing a paint(Graphics g) rather than a repaint before you wait.
-
How to Use Decode for manipulating time
How can i use Decode function to manipulate time...
Example
suppose ive employee and his time in...i want to display status field by using decode,which reflects if that employee came after 09:15:00 the status='L' else this will print 'P'
i tried this
SELECT pin_code,DECODE( to_char(ACCESS_TIME,'HH24:MI:SS'>'09:15:00','l','P'))STATUS
FROM ATTENDANCE_REG
this query hasn't work...
waiting for reply
Regards
Danish HayderSQL> select case when to_number(to_char(sysdate,'sssss')) > 33300 then 'L'
2 else 'P' end status
3 from dual;
S
L
1 row selected. -
How to lock everything except certain text fields?
I was once sent a Microsoft Word document that could not be edited other that tabbing through text fields for the purpose of filling out answers to questions. The questions were password protected and couldn't be directly edited.
I want to know if Pages can duplicate that very thing. It would make for excellent templates. I want to be able to tab over text fields without myself or anyone else being able to directly edit most of the document.
How can I do this?Hello SirMcGyver,
welcome to the Pages Discussionns. To lock shapes, textboxes and every other object use the menu item "Arrange/Lock" after selecting the objects. But after that the object is locked for all actions, you only can select them for unlocking.
If you want to have this feature exported into a Word document, this is not possible with Pages 1.0.2.
Frank. -
How much HD space for Local Time Machine?
Hi and thanks for reading..
I am noticing that since i have instlled Lion, if I cancel a file (even big) and empty the trash, the free space in my HD does not decrease.
May be it is due to the local time machine backup?
I have tried to connect the external time machine backup but after the time machine backup I have no improvement in the internal HD...
Any suggestion?
I am also wondering how much HD space is dedicated to the local Time Machine Backups.
Thanks, byeI believe this will answer your questions.
http://web.me.com/pondini/Time_Machine/30.html
Maybe you are looking for
-
How can I reduce the file size of 3 videos?...
...without losing quality? These three videos are as follows in terms of size and length of the video: 1) 148MB 19minutes 2) 357MB 18minutes 3) 164MB 14minutes I tried using a video converter to reduce the bit rate in order to reduce the size, which
-
Error while posting GR on a PO
Hello Guys, I'm having this error when I tried to post a GR against a PO on a certain line item. Error message: G/L account 611xxx Axx does not exist. When you try to check the G/L account of the line item in the PO however it is different. I don't k
-
Hyperlink to a file stored on a server
Hi guys, I've created dynamic pdf in LCD. It allows creating hyperlinks, but unfortunately only to web locations. I'd like to create a link that connects to a file stored on a server based on the DFS file system. Is it possible to do something like t
-
Any thoughts?
-
Will AIR has any problems in the future with Android?
Will AIR has any problems in the future with Android? If we are experienced in flash, is it better to do the mobile work with AIR or HTML5? But we are doing flash only so that we may face problems if we faced any bugs, is it expected to have any bugs