Event can't excut.

Hi all :
this my code I want to display a Frame then clink a Button
,the Event will change the name of File but the code can't run
i tried to many way but the same , Please help me .
thx
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.sql.*;
import java.util.*;
import javax.swing.*;
public class mainClass//Type your name of class
public static void main(String args[])
JFrame f = new JFrame();
Container contentPane = f.getContentPane();
contentPane.setLayout(new GridLayout(2,1));
JLabel l = new JLabel(new ImageIcon("ERR7.GIF"));
JButton b = new JButton(new ImageIcon("check.GIF"));
contentPane.add(l);
contentPane.add(b);
f.pack();
f.show();
f.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public void addWindowListener(ActionEvent e)
File f1 = new File("1.txt");
if (f1.exists())
{System.out.print("ok");
// f1.renameTo("2.txt");
}

then the button be clink 1.txtx change to 2.txt
public void addWindowListener(ActionEvent e)
File f1 = new File("1.txt");
if (f1.exists())
{System.out.print("ok");
f1.renameTo("2.txt");
}

Similar Messages

  • Canalyzer OnInit event can't be accessed

    I can access the com objects
    methods but I can't use the events (can't see them). Does anyone know why?
    I must get access to  the OnInit event. 
    Solved!
    Go to Solution.

    You should use the 'Register Event Callback' function on the ActiveX palette, you feed your com object into the 'Event' terminal, select the appropriate event (OnInit) and right click on the 'VI Ref' terminal and select, 'Create Callback VI'.
    This will create a VI with the correct terminals, in this VI you should deal with the event. You could forward it into a user event.
    Let us know how this goes.
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Subsequent to Yosemite or updates, my repeating calendar events can not be updated as before. When I update an event (of the repeating event) on my MacBook Pro; its reverts back when I shut it down and come back, and doesn't update other devices?

    Subsequent to Yosemite or updates, my repeating calendar events can not be updated as before. When I update an event (of a repeating event) on my MacBook Pro; its reverts back when I shut it down and come back, and doesn't update other devices?
    Has anyone experienced this and does anyone know a fix?

    This is incredibly frustrating for me too!
    I have a repeated monthly event for a discount at a store that is offered on the first Tuesday of every month. So I have a repeated event taking place on the 1st of every month. In the previous month I reset next month's date from the 1st to whatever date falls on the first Tuesday.
    But ever since upgrading to Yosemite, I am experiencing the same problem as the original person who posted. The date saves on my calendar but does not sync to my iCloud. When I reboot the computer, the date reverts back to the 1st.
    I'm thankful I don't have any events that needed to be tracked because ALL of my previous changes in the past have reverted back to the 1st of the month. I would have been in the same terrible situation as yaz999 in having to manually change every event in previous months.
    Why hasn't this bug been fixed yet???!!!

  • HT6012 While trying to update projects and events from a previous version of iMovie to iMovie '11, someone forced iMovie to quit.  Now when I start iMovie '11 and try to update, a message says no projects or events can be found?  Any suggestions?

    While trying to update projects and events from a previous version of iMovie to iMovie '11, someone forced iMovie to quit.  Now when I start iMovie '11 and try to update, a message says no projects or events can be found?  I know there are previous projects and events, and they definitely have not been updated because they do not show up in my iMovie'11 library, events, or projects.  Any suggestions?

    I also have Jolly's problem. I found the iMovie 9.0.9 folder and tried to launch the older version of iMove. It would not launch. I removed all of the iMovie preferences from the Preferences folder, removed iMove 10 from the applications folder, and restarted my Mac. iMove 9.0.9 still won't launch and I can't access my videos created with the older version of iMovie. Is there a way to uninstall iMovie 10 and reinstall iMovie 9.0.9?
    I am running Yosemitie on a  iMac.
    Paul

  • Some Calendar events can't be deleted

    I have several repeating calendar events that I created in my home calendar (icloud) which can't be deleted. Under event details the "edit" and the "delete event" is missing. I can't delete or modify these events at all. Dragging and dropping the event doesn't work either. The cloud is syncing fine as both my iphone and ipad have all the same events with the same issue.

    I am having the same issue.  I created a repeating event and invited others to it.  It won't let me edit it, nor delete it.  I changed my status to "Decline" and it disappears; however, as soon as I try to exit the event window, everything shows back up and my status reverts to "Accepted."  The only two buttons I have access to is "Revert" and "Reply."  Both end up with the same results - event still shows up and I am still in an "Accepted" status.
    I tried editing the original entry as well as follow-on events (later in the repeating cycle).  I cannot edit anything other than my status, which doesn't change in the end.
    I am running Mountain Lion 10.8.1 on a 6-core Mac Pro.  This issue also occurred within Lion (10.7.x).
    It also does the same thing on my iPhone - I decline the event, it disappears, but then pops back up a few seconds later.
    I am using an iPhone 4 using iOS 5.1.1
    Any ideas on how to delete (or even modify times, dates, locations, etc.)?
    Jim

  • In making a "highlights" movie, using clips from different imported iMovie events, can I delete the larger iMovie event file from the Events browser and still work w the smaller clips in the Projects browser w/o having the larger files still loaded?

    I have sucessfully imported 150 Sony digital 8mm movies (each one hour in length) into iMovie as 150 iMovie events. I have since successfully converted them from their original 13 Gb (.dv) file to an exported smaller 1.3 Gb (.4mv "large file") movie that I am happy with, using the iMovie projects browser. So now I have 150 " .4mv" movies on my internal HD as well as about half of my original raw data " .dv " movies on my internal hard drive.
    Due to their large size (over 2 Tb), I do not have all the larger raw data (.dv) files on my 2Tb internal drive, just about half of them. What I want to do now is to create a new project in the Projects browser for each of my kids, and reload, starting with Tape #1, each of these larger files and do a highlights movie for each of my kids, wherein I pick out smaller clips from each 1 hour .dv iMovie event and paste them into the appropriate kid's Highlights project in the Projects browser.
    Here's my question: If I load the first 5 large files back onto my internal HD, and paste in various shorter clips into each of my kids' Highlights project, and then if I delete those first 5 large files (they are backed up on 2 other 3Tb external HDs), can I keep doing this (reloading the next 5 large .dv files to work with), and ultimately take each of my kid's Highlights project and export as a .4mv movie EVEN THOUGH the earlier large .dv files are no longer on my internal HD, OR does my iMac need to have all these larger files loaded on my internal HD for me to eventually export each of my kid's Highlights project to a .4mv movie?
    I have a 2011 era 27" iMac desktop w 2Tb HD internal and 250 Gb flash drive, and Lion OSX and iMovie 11.

    Thanks. I tested it out and you were correct. I loaded 2 .dv movies from my external HD back onto my internal HD, and got them re-imported into iMovie, took a few short clips from each of the 2 iMovie events and pasted them into a new project in the Project Browser. Then I deleted these 2  "source clips" from my internal HD, closed iMovie and then re-opened it and found that iMovie would NOT export the smaller clips for a "highlights" .4mv movie without the "source clips" being available.
    I read your link on Quicktime. It talks about mostly trimming, which is what I did with each iMovie event before I took each one as a project to export as a smaller .4mv file. But if I use Quicktime (do I need QT Pro or basic), what advantage is it to me to use QT over iMovie (I must admit I am a novice at iMovie and have never used QT or QT Pro as a tool)? Will it then convert any edits I make to a .m4v movie or do I need iMovie to do that?
    Does QT allow trimming multiple segments out of a movie during one edit session, or can you only do 1 at a time? By that I mean that, for example, when I use Sonys Picture Motion Browser for my .mts movies, you can only set one Start and one End point for each edit/trim you do: it does not allow you to set multiple Start Stop points like iMovie allows in its Event or Project browser. You can only do one "trim" at a time, save it and then reopen to do another trim. not very useful.

  • Add row in Memu Event can't work

    1:I create a Master UDO
    2:Regist UDO with a child table
    3:use UDO form generator tool to generate a UDO form with xml file
    4:I use load from xml funtion to call form.
    5. Add a buttom name "Add row" and have code with Add a row for matrix 
    I have two problems
    one is,
    I can add row by press "Add row" button and I can delete a row by UDO default menu("delete Row CtrlK"). My problem is why the default menu(Add Row CtrlI) don't work? May I write code for add a row by myself?
    The other is
    When I add menueven sub(catch menueven) in program ,my "Add row" buttom can't work normally. If I remove the menueven sub from my program, the  "Add row" buttom work fine. Why? somebody help me.

    Hi Glen,
    In my case, I developed own functionality to add row for a matrix.
    I don't use 'add row' menu event actually.
    And I don't know about menu event sub problems without any source code.
    Regards,
    Hyunil.

  • When creating a event can't choose starting time.

    I just got a new mac air with yosemite. When I create a event in ical it won't let me choose a starting time, it just sticks a time in there and that's it, i can't change it. But I can change the end time though.

    Hey cdrea,
    It is not quite clear from your description how you are creating the events in your Calendar application that you are describing, but you should be able to change the starting time for them. See this article -
    Mac Basics: Calendar keeps your appointments - Apple Support
    You can drag and drop the event to the correct time or use the Inspector -
    Double-click anywhere on the calendar to add an event at that time. The Inspector window that appears allows you to add invitees, set a time, location and more.
    Drag an event to reschedule it.
    Double-click an existing event to edit it from the Inspector.
    Thanks for using Apple Support Communities.
    Be well,
    Brett L 

  • How SAP Event can be caught from Adapter

    Hi All,
    How can I catch the event on -
    1. Pressing the Start and Stop button in Runtime Workbench after selecting Adapter Communication Channel.
        OR
    2. Adapter Status flag (Active/Inactive) in Communication Channel of Adapter in Integration Directory
    from my own (third party custom) code ?
    I have my custom adapter writen in Java and I want to catch the event on as above from my Adapter to activate or deactivate my adapter. Please help !
    What should I need to do (to import certain SAP jar OR ...) in my code to achieve this.
    Thanks In Advance
    Shalindra Singh

    Hi,
    Thanks for the reply-
    The blog is to get the access of channnel externally, by this I will not be able to stop and start the channel from RWB.
    But what I need is, I want to start or Stop the Channel from RWB only, but i want to catch this event externally so as I may triggered some other functionality written in my custom Adapter code as soon as Start or Stop event button is pressed in RWB.

  • Scanning into iphoto 08 creates single events can I change that?

    When scanning photos into iphoto 08 with my epson flatbed my individual scans show up as single events, so if I scan 100 pictures of Dad I have 100 separate events. Is there a way to pre-select creating one event before I begin the scan process? Also is there a way to target the event I want a scan to end up in?

    Six peps
    Welcome to the Apple user discussion forums
    No and No
    But once you scan several you can select all the events you just created and click merge and merge them into one event
    Or scan to a folder on the desktop and then import that folder into iPhoto (probably want to turn off the option to split items imported from the finder into events)
    LN
    Message was edited by: LarryHN

  • Very weird event-can anyone make sense of this?

    Can anyone explain this:
    Last night while on Firefox (3.5) was editing a post (not here) when, all of a sudden, the text cursor reversed direction uncontrollably and, character by character, deleted (swallowed up) everything I had written. Clicking didn't stop it.
    Don't know if this started exactly at this moment, but heard a continuous series of error beeps which persisted even after FF was closed, with the mouse pointer now flickering constantly. Re-opened FF (page was now dimmed, but came back to life when I clicked on it). No change with flickering mouse pointer and constant error beeps.
    Then went into DU and verified disc and permissions. Everything OK there--SMART status verified, no funny sounds from the drive--and nothing at all written to Console or the Firefox crash log. I think the OS was still responding throughout this event, despite the constant error beeps and the flickering mouse pointer. Was able to access DU during this. Nothing crashed. I think only FF, Mail app, maybe Console (which I keep in the dock), and TextEdit were open at the time.
    Re-booted and everything seemed back to normal. Then ran Applejack (lower case) through its paces, including caches and preferences in user account. So far, after re-booting again this morning, everything seems normal. Don't think this was a Firefox issue, since the flickering mouse pointer and error beeps persisted even after quitting FF.
    What was this?

    You could wait for the iVac Family Pack subscription, only $169 per year with the iGhost Flippy Bit® extension with pre-order...
    iVac minimum System requirememts...
    4 16-Core Intel Tukwila proccesors
    256 GB RAM
    3 Exo Bytes of free Disk space (6 EB if you don't have 500 MB/Sec Broadband)
    42 channel Surround Sound Audio card for realistic Vacuum sounds
    Video card with 16 GB VRAM and a 42" or greater monitor
    42x Blu-Ray 9 drive for installation
    8 pints of Blood
    A note from Steve specifying your goodness

  • My wait events - can anyone see a problem?

    hi,
    this is what i have, can anyone see a problem?
    thanks
    EVENT                               TOTAL_WAITS  PCT_WAITS TIME_WAIT_SEC PCT_TIME_WAITED TOTAL_TIMEOUTS PCT_TIMEOUTS AVERAGE_WAIT_SEC
    Streams AQ: qmn slave idle wait          148147         .3    4051461.88           38.04           3478          .07            27.35
    Streams AQ: qmn coordinator idle wa      291006        .59    3962890.53           37.21         148370         3.13            13.62
    it
    Streams AQ: waiting for time manage         948          0     2021434.2           18.98            948          .02          2132.31
    ment or cleanup tasks
    control file parallel write             1292057       2.64     266839.64            2.51              0            0              .21
    log file parallel write                28433394      58.02     134658.55            1.26              0            0                0
    db file sequential read                 8307195      16.95      69830.07             .66              0            0              .01
    free buffer waits                       3117839       6.36      43374.04             .41        3106093        65.55              .01
    log buffer space                          55520        .11       20810.2              .2          20235          .43              .37
    db file scattered read                   583604       1.19      18169.58             .17              0            0              .03
    write complete waits                      17946        .04      17536.66             .16          17941          .38              .98
    log file sync                            282268        .58      10005.35             .09           9369           .2              .04
    enq: RO - fast object reuse               26602        .05       6623.44             .06           2171          .05              .25
    enq: CF - contention                       1839          0       5178.14             .05           1723          .04             2.82
    Streams AQ: qmn coordinator waiting         999          0       4311.01             .04            883          .02             4.32
    for slave to start
    buffer busy waits                         32464        .07       3898.51             .04           3950          .08              .12
    control file sequential read            2199199       4.49       3558.34             .03              0            0                0
    SGA: MMAN sleep for component shrin      234330        .48       2523.65             .02         234216         4.94              .01
    k
    buffer exterminate                         1583          0       1539.72             .01           1573          .03              .97
    library cache pin                           317          0        927.71             .01            316          .01             2.93
    enq: CI - contention                       1829          0        570.84             .01            159            0              .31
    log file switch completion                 1658          0        517.18               0            425          .01              .31
    enq: TX - row lock contention               257          0         438.8               0            149            0             1.71
    read by other session                     27269        .06        355.17               0             52            0              .01
    os thread startup                          3869        .01        338.67               0             98            0              .09
    latch: shared pool                          760          0        285.87               0              0            0              .38
    latch: row cache objects                    664          0           250               0              0            0              .38
    Data file init write                      16324        .03        231.59               0              0            0              .01
    reliable message                          19189        .04        218.16               0            170            0              .01
    latch: library cache                        483          0        172.51               0              0            0              .36
    SQL*Net message from dblink             1143086       2.33        128.69               0              0            0                0
    latch free                                 6091        .01         121.1               0              0            0              .02
    library cache load lock                      90          0         89.48               0             18            0              .99
    log file single write                      1894          0         69.76               0              0            0              .04
    cursor: pin S wait on X                    5183        .01         55.87               0           5165          .11              .01
    local write wait                           6732        .01         42.58               0              2            0              .01
    log file switch (checkpoint incompl          95          0         42.11               0             30            0              .44
    ete)
    row cache lock                              119          0         30.96               0             10            0              .26
    SQL*Net more data from dblink             17198        .04         25.92               0              0            0                0
    log file switch (private strand flu          69          0         17.54               0              5            0              .25
    sh incomplete)
    enq: HW - contention                        180          0         16.53               0              5            0              .09
    enq: PR - contention                          9          0          14.5               0              2            0             1.61
    enq: JS - queue lock                         51          0         12.36               0              0            0              .24
    SQL*Net more data to client               48311         .1         11.66               0              0            0                0
    enq: TM - contention                         12          0         10.66               0              3            0              .89
    class slave wait                           3128        .01          7.03               0              1            0                0
    JS coord start wait                          68          0          6.42               0             68            0              .09
    direct path write                         92712        .19          6.06               0              0            0                0
    control file heartbeat                        1          0          3.91               0              1            0             3.91
    PX Deq: Par Recov Execute                   100          0           3.8               0              0            0              .04
    log file sequential read                   1900          0          2.88               0              0            0                0
    single-task message                          50          0          2.61               0              0            0              .05
    enq: TX - contention                         11          0          2.38               0              0            0              .22
    undo segment extension                  1181001       2.41          1.95               0        1180981        24.92                0
    db file single write                        165          0           1.3               0              0            0              .01
    enq: TX - index contention                   97          0          1.27               0              0            0              .01
    LGWR wait for redo copy                   20840        .04           .66               0              0            0                0
    JS kgl get object wait                        8          0           .63               0              8            0              .08
    SQL*Net message to dblink               1143086       2.33           .55               0              0            0                0
    kksfbc child completion                      14          0           .55               0             11            0              .04
    direct path read temp                    217237        .44           .41               0              0            0                0
    latch: cache buffers chains                2138          0           .37               0              0            0                0
    latch: messages                            1245          0           .27               0              0            0                0
    latch: redo writing                         786          0           .15               0              0            0                0
    PX Deq: Par Recov Reply                      65          0           .09               0              0            0                0
    latch: checkpoint queue latch               171          0           .09               0              0            0                0
    latch: redo allocation                     1029          0           .08               0              0            0                0
    latch: cache buffers lru chain              268          0           .07               0              0            0                0
    SGA: allocation forcing component g           5          0           .05               0              2            0              .01
    rowth
    db file parallel read                        83          0           .04               0              0            0                0
    latch: In memory undo latch                 558          0           .04               0              0            0                0
    latch: object queue header operatio         338          0           .04               0              0            0                0
    n
    direct path read                           5042        .01           .03               0              0            0                0
    PX Deque wait                                 7          0           .02               0              0            0                0
    direct path write temp                     4691        .01           .02               0              0            0                0
    enq: SQ - contention                          1          0           .02               0              0            0              .02
    latch: session allocation                   190          0           .02               0              0            0                0
    PX Deq: Join ACK                             15          0           .01               0              0            0                0
    cursor: pin S                               894          0           .01               0              0            0                0
    enq: TX - allocate ITL entry                 37          0           .01               0              0            0                0
    kkdlgon                                      15          0           .01               0              0            0                0
    latch: enqueue hash chains                   37          0           .01               0              0            0                0
    library cache lock                            1          0           .01               0              0            0              .01
    Log archive I/O                               1          0             0               0              0            0                0
    PX Deq: Par Recov Change Vector               2          0             0               0              0            0                0
    PX Deq: Signal ACK                            3          0             0               0              0            0                0
    PX Deq: Test for msg                          1          0             0               0              0            0                0
    PX qref latch                                 1          0             0               0              1            0                0
    SQL*Net break/reset to dblink                 5          0             0               0              0            0                0
    SQL*Net more data to dblink                   1          0             0               0              0            0                0
    buffer deadlock                              27          0             0               0             27            0                0
    checkpoint completed                          4          0             0               0              0            0                0
    cursor: mutex S                               3          0             0               0              0            0                0
    cursor: mutex X                               1          0             0               0              0            0                0
    enq: JS - q mem clnup lck                     1          0             0               0              0            0                0
    enq: PS - contention                          2          0             0               0              0            0                0
    enq: US - contention                          1          0             0               0              0            0                0
    instance state change                         2          0             0               0              0            0                0
    latch: library cache lock                     4          0             0               0              0            0                0
    latch: library cache pin                      1          0             0               0              0            0                0
    latch: object queue header heap               8          0             0               0              0            0                0
    latch: undo global data                       3          0             0               0              0            0                0
    recovery read                                39          0             0               0              0            0                0

    Hi,
    If its for a week than I won't bother. Probably you should try to get teh same report for these wait events in a much smaller period , like 20-30minutes of time period when your db is fully operational. If still at that time the wait events,these or any other, shoot up to high wait times, things can be investigated more deeply.
    HTH
    Aman....

  • Repeating event: Can't delete - pops back up

    Hi,
    I have several weekly repeating events. Usually, during my vacation or on other occasions, I simply deleted the repeating events for these out-of-the-row week - until now.
    All of a sudden iCal won't let me delete these events anymore. Well - it asks the standard question if it should remove all following repeating events or just this one. I select "just this one" - and iCal deletes it for about 3 or 4 seconds. And then - surprise! - it's back there!
    Feel kind of fooled here..
    Hint: Since some months, i synchronize my iCal with an iPod. Maybe it has to do with it. But it functioned even then until today...
    Fox

    Hey Foxboy71,
    Really sorry, this is completely off-topic, but there's no private messaging on the Apple Forums.  I note you used to use a TASCAM FireOne, and I was hoping you could tell me whether the line outputs on the rear are balanced or unbalanced stereo?  TASCAM dropped the ball on this one regarding the documentation and I've been calling every shop I can find that ever stocked this thing and still haven't got a definitive answer
    Like I say, sorry for hijacking the thread, but you've no idea how hard it is to find someone who's actually used one of these!
    Regards,
    S.

  • HT2265 for some reason the only photos that do the random scrolling are events, can I include the albums from iphoto to scroll as well.   the know the albums have synced because i can view them in slideshow

    for some reason the only photos that do the random scrolling are photos in the events section of iphoto. is it possible to include the albums from iphoto to scroll as well.   the know the albums have synced because i can view them in slideshow  pls help

    Welcome to the Apple Community.
    I assume you are referring to the screensaver. You can change the photos used by the screensaver in the screensaver settings. Note if you have a large number of photos in the collection you choose for screensaver, not all of them will be used due to the limited storage available to the Apple TV.

  • Auditing cluster events - can we see who paused a node?

    Hello
    We have a 2 node cluster with an active passive configuration - running server 2008 r2 / SQL 2008
    We had an issue today where one of the nodes was paused; and the active node had an issue with the cluster services, which ended up taking the resources offline (as you would expect)
    I fixed the issue via resuming the paused node; failing over the resources and restarting the cluster services - and bringing the resources back online
    Im trying to find out the 'why' behind the inactive node being left paused, as such i want to know if there are any events logged when a node is paused (i.e. a security event)
    I did a test scenario on the server, I paused the node but nothing is logged in any of the usual event places. Does the inactive node have to be left paused for a certian period of time before the cluster events / cluster operations log start logging things?
    Any help would be appreciated

    Hello,
    After checking the cluster related logs and systme/application logs, it appears that there're no logs recorded when pausing a cluster node.
    And generally, pausing a node is usually done when applying software updates to the node, where the recommended sequence is to move all services and applications off of the node, pause the node, then apply software updates to the node.
    You may refer to the following link for more information.
    Pause or Resume a Node in a Failover Cluster
    http://technet.microsoft.com/en-us/library/cc731291.aspx
    Best Regards,
    Sophia Sun
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Thanks - I was afraid of that
    I know that pausing a node is only usually done when updating / patching etc, but windows updates fore this cluster are not done whatsoever - which put me down this path to begin with
    Appreciate everyones input on this

Maybe you are looking for