Help please - how to set an alarm with time?
Hi guys,
I have got a task here, basically it required me " to displays the time and can set an alarm, which sounds at the right time." (when match it)
Well, I have created 2 edit boxes, and a button and a radio box. When I typed both the equal string into the edit box, the string will say match! However,I couldn't show the time that run by thread code...
any guess?
here is the code:
import java.awt.*;
import java.applet.*;
import java.awt.Graphics;
import java.util.Date;
public class j27 extends Applet {
AudioClip audClip;
String Msg1=null;
String Msg2=null;
Label info;
TextField box1Text;
TextField box2Text;
Checkbox charTrue;
int myVar1=0, myVar2=1;
Font theFont=new Font("TimesRoman", Font.BOLD, 24); //
Date theDate; //
Thread runner; //
public void init() {
info = new Label ("string and integer demo j27.java");
add (info);
box1Text=new TextField("12");
add (box1Text);
box2Text=new TextField("34");
add (box2Text);
Button load=new Button("process");
add (load);
charTrue=new Checkbox ("treat input as text");
add (charTrue);
public boolean action (Event event, Object object) {
if(event.target instanceof Button) {
Msg1=box1Text.getText();
Msg2=box2Text.getText();
if (charTrue.getState() !=true) { //test for text or integer input
myVar1 = Integer.parseInt (Msg1); //if integer input convert string
myVar2 = Integer.parseInt (Msg2); }
repaint(); }
return(true);
public void start()
if (runner == null)
runner = new Thread (this); //new thread
runner.start();
public void stop() {
if(runner!=null) {
runner.stop(); //kill thread
runner = null; }}
public void run()
while(true)
theDate = new Date();
repaint();
try {Thread.sleep(1000);} //thread sleeping 1 second
catch (InterruptedException e) {}
public void paint (Graphics g) {
g.setFont(theFont);
g.drawString(theDate.toString(),10,50);
if (Msg1 !=null) g.drawString( "box1=" + Msg1, 30, 140);
if (Msg2 !=null) g.drawString( "box2=" + Msg2, 30, 150);
if (charTrue.getState()==true) { //text for text or string
if (Msg1.compareTo(Msg2)==0) g.drawString ("strings match!", 30, 160); }
else
if (myVar1 == myVar2) g.drawString ("integers match!", 30, 170);
else
audClip = getAudioClip(getCodeBase(),"loop.au");
audClip.loop();
}
Please use:
[code]
//my code here[/code]
when posting code
Similar Messages
-
Help Please: how to set JDBC properties for data encryption in BC4J
Hello,
I am trying to implement JDBC Thin Driver Support for Data Encryption and Integrity.
With java.sql.Connection and java.util.Properties, one would do something like the following code:
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Properties props = new Properties();
int level = AnoServices.REQUIRED;
props.put("oracle.net.encryption_client", Service.getLevelString(level));
props.put("oracle.net.encryption_types_client", "( RC4_40 )");
props.put("oracle.net.crypto_checksum_client",Service.getLevelString(level));
props.put("oracle.net.crypto_checksum_types_client", "( MD5 )");
Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:1521:main", props);
But, how can we do this with BC4J objects? Can we set this properties via EnvInfoProvider class? Please help. Thank you very much in advance.
ZhirongHi,
Try adding the code in the PBO part of your custom program used for the custom screen which you have created and added inside the BADI.
Regards,
Harish -
i am a OS10.7.4 user. yesterday i bought a Lacie external hard disk but error message appear said " You cant open the applicant LaCie setup assistant because PowerPC applicants are no longer support". please help me how to connect my mac with Lacie??
You do not need the Setup Assistant; in fact, you do not need any software on an external hard drive. I have two LaCie's; I erased the drive as soon as I plugged it in. You will need to format it anyway because most hard drives come Windows formatted. So, if you only want to use it with the Mac, highlight it in Disk Utility and choose Mac OS Extended (Journaled) as the format and the GUID Partition scheme under Options. While doing that, it will erase the drive (and get rid of the LaCie software) - once finished, your drive is ready to use for Time Machine or any other backup plans you have for it.
-
How to set up SAPconnect with email server
Hi,
Does any one know <b>how to set up SAPconnect with email server</b>
We are using workflow and when it fails it we are sending the notification mail to the user on his company mail id, i.e. [email protected]
This is working in the current production system. We are doing the new development which will replace the current production system. The existing Basis team does not know how it was setup in production system and how to set it up in the new system.
When we send any mail notification from workflow we can see the mail in SCOT transaction but it is not received at the specified mail address.
Can any one provide the configuration steps or any document for this.
Thanks in advance..
PratikHi Pratik,
Check the following link:-
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
http://help.sap.com/saphelp_nw04/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
these link will help u to config SMTP.
And one more thing u have to do..
Go to SE11 n open Table sxnodes in change mode.
And change F_ESMTP field to false i.e. BLANK for the Field NODE = SMTP.
Hope this will work For U.
Regards
Sachin Dhingra -
How to set this filters with 'or' relationship
Hi Pros,
I have a query as follows, rows and columns are all in structures.
regular_employees
active_employees
lay_off_employees
I want to set up filter as ' employ_status = 0 or employ_subgroup =2' for this query, please tell me how to set this filters with 'or' relationship.Hi Yifei,
Create a formula and enter this (let's name this FORMULA_KF):
((EMPLOY_STATUS = 0) OR (EMPLOY_SUBGROUP = 2)) * enter value IF_TRUE + enter value IF_FALSE
Then create the condition to HIDE the rows having those values to be filtered (if this is your purpose)..
Like,
FORMULA_KF <> 1
Is this what you want mate?
Regards,
Loed -
How to set an alarm for tomorrow morning.
Ask siri... "Wake me up at 7:00 am."
Press and hold the home button at activate Siri and say the above phrase.
You can view/edit this. Open the "Clock" app and click on Alarm, second tab from the left. You'll see the alarm with the on/off ticker on ON (green). Press Edit to delete/edit the alarm. Set a Repeat if you want to have to go off every * days. And you get to choose what would be the sound that it uses. Personally I have it to play one of my songs from my music library. Also have the Snooze on so that I can just tap the screen to give me a 10 minute snooze.
KOT -
Hi all, I bought one iphone and 3 ipads, i set up all on one apple ID. Now i have a problem when using messages: when sending message from one device it appears again on screen from the other 3 devices. I need help on how to set up messages on each device separately and to start using messages app on each device independently. Thanks
search google for "iphone remove picture from contact"
-
can anyone help please. how do i get the home button to appear on the touch screen my home button has stopped working?
I have same problem.
However, I am unable to turn on Assistive Touch.
At one time I was able to activate it, but it went away and now I cant reactivate.
What is the solution? -
So i recently bought an Apple AirPort Extreme BaseStation (the mushroom shaped one) and was wondering if someone could tell me where and how to find a power cord and how to set it up with my Macintosh (2011 edition with 1.7.5) Thankyou!
Welcome!
Last question first, as we need to know what operating system that the Mac is using.
If you are not sure, click the Apple icon in the upper left corner of the screen, then click About This Mac, and post back with the OS X Version number that you see there.
Two possible solutions on the power cord
ORIGINAL OEM APPLE AIRPORT EXTREME BASE STATION POWER SUPPLY AC ADAPTER A1202 if you want a white power supply and white power cord to match up with the Apple device
AC adapter for Apple AirPort A1034 Extreme B... if you don't care what color the supply and cord might be
If you don't already have a Setup Guide.....look here:
AirPort Extreme Base Station Setup Guide v4.2 (Manual) -
How to set task description with paragraphs at runtime
Hi Experts, How to set task description with paragraphs at runtime. Now, i can set single content in task description.however, not sure, how to set content which have paragraphs.
Hi,
You can use HTML tags in the Task descritption.
Open the task not the workflow and there you can provide
<p> content/containers </>
You can use even <u>- Underlined text.
<h> for bold text
Thanks,
Sarayoodharan.K -
I am having difficulty getting my scanner (HP5590 Scanjet) working with my MacBook Pro, can anyone help please. It did work alright with my IBM notebook.
There's a new driver bundle for OSX 10.6 that you might need to install, the HP link seems to be failing at the moment but there's a version of it here: HP_Installer_Scanjet_v2.4.3_Ph4.dmg
There's a piece on the HP Forum about it here (some folks have problems installing ...)
http://h30499.www3.hp.com/t5/Macintosh-Compatible-Products/Scanner-Drivers-softw are-for-Snow-Leopard-Mac-OSX-10-6-will-not/td-p/2301674 -
How to setup airport express with time machine
just bought airport express so i can extend my wifi range,can anybody help on how to set up! I have time machine 2gb, my house is wired with cat6 cable in all the bed rooms, but now only half my house get wifi,so i want to extend it.I know i have to go into air utility and change some stuff, but sure what stuff?
I assume that this is a new AirPort Express and you have not tried to configure it previously.
Locate the AirPort Express in the general area where you would like to have more wireless signal coverage.
Connect the Ethernet cable to the WAN "O" port on the back of the AirPort Express
Power up the AirPort Express and let it run a few minutes. The amber light will be blinking slowly at this point.
Click the AirPort icon at the top of your Mac's screen and wait a few seconds for a listing of New AirPort Base Station to appear. Just below that, click directly on AirPort Express.
AirPort Setup will open up automatically on your Mac, take a minute to analyze the network, then announce that the AirPort Express will be configured to extend the Time Capsule network.
Enter a device name that you want to use for the AirPort Express and click Next
Wait a minute while AirPort Setup configures everything for you. When you see the indication of Setup Complete, click Done.
You should be all set. -
How to do a backup with time machine?
Hi Communitieee,
I dont know how to make a backup with time machine. Can anybody help me?
And i have another question.. whats wrong with library? when i start my mac the message is popping up but i dont know what it means..
Thanks
KROk thanks mende1.
Whats with time machine? I already take a look to the link but i could not find the answer of my problem. Can you please take a look of this screenshot?!
I dont have an extern hard drive. i just want to save my pics and the other data of my mac. -
How to Set A Default Start Time For New Events In Calendar?
How to Set A Default Start Time For New Events In Calendar?
John,
Thanks for that suggestion - could not get it to work. However, I did manage a different approach. I finally determined the sequence of events in terms of how the various events and listeners fire (I think).
Basically, the CalendarActivityListener fires, followed by the listener associated with the Calendar object's Create facet, followed finally by the CalendarEventListener - the final is where the TriggerEvent is available and then finally, control is passed to the popup/dialog in the Create facet. So, my approach of trying to set/get the TriggerDate in the user's HTTP session was doomed to failure because it was being get before it had been set :(
Anyway, I ended up adding a bit of code to the CalendarEvent listener - it grabs the current BindingContext, navigates through the DCBindingContainer to derive an Iterator for the ViewObject which drives the calendar and then grabs the currently active row. I then do a few tests to make sure we're working with a "new" row because I don't want to alter start & end dates associated with an existing calendar entry and then I define the Start and End dates to be the Trigger Date.
Works just fine. Snippet from the listener follows
BindingContext bindingContext = BindingContext.getCurrent();+
*if ( bindingContext != null ) {*+
DCBindingContainer dcBindings = (DCBindingContainer) bindingContext.getCurrentBindingsEntry();+
DCIteratorBinding iterator = dcBindings.findIteratorBinding("EventsView1Iterator");+
Row currentRow = iterator.getCurrentRow();+
if ( currentRow.getAttribute("StartDate") == null)+
currentRow.setAttribute("StartDate", calendarEvent.getTriggerDate());+
if (currentRow.getAttribute("EndDate")==null)+
currentRow.setAttribute("EndDate", calendarEvent.getTriggerDate());+
*}* -
How to set olite auto sync time interval
Hi all,
How to set the auto sync time interval for a publication item, publication or to a user.
Can anyone tell me, which one is best among setting the auto syncing and syncing with the code.
I am searching for the code to sync in java only upload or download and both. I tried with some code but it is giving me oracle.lite.mSync.SyncException: AES encryption error.
Thanks in advance,
KhadareeBonjour,
Même demande ;-)
Maybe you are looking for
-
Error While Uploading Salary (F-02)
Hi, While Uploading Salary Using the BAPI Upload Program it shows an error ' No hierarchy variant assigned to FM area 2000 ' Where in the same program works fine in the other client (DEV) could someone tell me what would be the problem? and whats the
-
Hi, While creating the Vendor master record i IDES i am getting an error . System prompts for the Reconciliation account. Prior to creation of vendor master record i already have done following configurations 1.I CREATE COPY OF CHART OF ACCOUNTS from
-
Why doesnt this query work on CF when it works fine on MYSQL?
Topic says it all. I can run this through mysql console and get the result i need but when i place it inside a cfquery it wont process. SET @saldo=20000; SELECT IF(co.transtipo=0,@saldo:[email protected],@saldo:=@saldo+t.transmonto), @saldo:=@sald
-
im mad
-
XCode not finding libgmalloc.dylib when deploying to iPhone
I have an iPhone app that runs great on the simulator, and which ran on my phone too, but now (I think since upgrading to beta 7), when I try to deploy to a device, it can't find the GuardMalloc library (libgmalloc.dylib). Under the simulator it can