How to make a JDialog scrolling from one position to the other.

Hi all,
I want to move a JDialog from one position to the other(actually I want to scrolling/moving as messenger notification appear on top of the system tray) on the desktop.
Anyone of you can give me a clue.
Thanks

Ok here what I have try up to now. First make the initial position of the JFrame as follows.
    private void SetWindowLocation()
        final int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
        final int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
        final int frameHeight = this.getHeight();
        final int frameWidth = this.getWidth();
        int _y = (screenHeight - frameHeight - 32);
        int _x = (screenWidth - frameWidth);
// Initial location
        this.setLocation(_x, _y); 
}This code place my Frame in the lower-right corner on top of the system-tray.
Then as you guys says, try to work on a Timer. Now I'm stuck with the action listener. I try to move the frame to upper-right corner.
    private void SetWindowLocation()
        final int screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
        final int screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width;
        final int frameHeight = this.getHeight();
        final int frameWidth = this.getWidth();
        int _y = (screenHeight - frameHeight - 32);
        int _x = (screenWidth - frameWidth);
// Initial location
        this.setLocation(_x, _y); 
        _timer = new javax.swing.Timer(100, incrementYPosition);
ActionListener incrementYPosition = new ActionListener() {
        public void actionPerformed(ActionEvent evt) {
                   while(_y > 0){
                        // do the processing here.
                        // reduce the _y value and set the new location with _x
                };I'm stuck with that how to involve with the ActionListener here. :(:( After set the initial location how to deal with the ActionListener.
Any help.

Similar Messages

  • How can I import my iphotos from one account to the other?

    Someone knows step by step iphoto from one account to the other. I am admin but still I do not know how to bring my iphotos to a different account
    thanks for help
    marc

    Just the Photos?
    Export them from iPhoto to a folder on the desktop
    Put that folder in the Users/Shared folder.
    Switch User.
    Drag the folder from the Shared folder to whereever you want it.
    Share the Library?
    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder (but note: some users find ongoing permissions issues with the Library in this location. It might be better to use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.

  • How can I look up DataSource from one EJB to the other EJB?

    Image that, I have 3 databases:
    DB1
    DB2
    DB3,
    And then, 03 DataSources is deployed in DS EJB, named DataSource1, DataSource2, DataSource3.
    In the other App EJB, I have Connection Management function, as follows:
    public Connection getConnection(databaseKey) {
    if (databaseKey.equals("DB1")){
    connection = remote.lookup("DataSource1");
    }else if (databaseKey.equals("DB2")){
    connection = remote.lookup("DataSource2");
    }else if (databaseKey.equals("DB3")){
    connection = remote.lookup("DataSource3");
    return connection;
    How can I access DataSource 1,2,3 from the other EJB? How to config EJB server for that?
    Thanks in advance!
    Now, I have the other App EJB. Some class will require one of the above DataSource from DS EJB through function getConnection(databaseKey){}

    I strongle suggest you to use a ServiceLocator for this . It will be very easy to identify.Go to the sun home page and look for a servicelocator pattern.You can even directly use that code for you.

  • My daughter and I each have iTunes libraries on the same computer, how can I move some songs from one library to the other?

    My daughter and I each have iTunes libraries on the same computer, how can songs from one library be moved to the other?

    So, if she purchased a song from iTunes in her library, I will also have to purchase the same song to add to my library?

  • How to drag a painted square from one panel to the other?

    Hi there,
    I'm a student IT, and for the course Programming, which uses Java, we have to write a game.
    I've got a JFrame with two JPanels. Both are overriding paint(Graphics g). One JPanel, let's say JP1, draws a board with 196 squares, the other, JP2, draws 21 pieces made up from the same size squares. What I want is, when I press on a piece in JP2, that I can drag that piece over to the board, JP1, and when I release the mousebutton, the piece is drawn in the board.
    How can I realize the dragging part? I've tried with an extra JPanel, with the size of the JFrame, but then either JP1, JP2, or both won't draw anymore.
    Can someone help me with this?
    Check here for a paint what I mean (don't mind my painting skills :p). At no.1, the mousebutton is pressed on the piece, at no. 2 the dragging starts, and at no. 3 the mousebutton is released again.
    Hope I've provided you enough information, I would post the source code here, but it's a lot in Dutch, and it may just confuse you ;)
    Greetings,
    Niek

    Ok, I'll study the link, and try to post my threads in the right section next time ;)
    Didn't even came up with me there might be a tutorial or something for this..
    Thank you! ;)
    Edited by: Niekfct on 17-mrt-2009 21:19

  • How do I transfer purchased apps from one mac to the other?

    When i want to sync my iPhone in iTunes on my new computer I will lose all of the apps that I purchased.
    Can someone tell me how to sync it in a way (or some other solution) so I can keep my purchased apps? 
    I'm using the same ID as on old mac.
    I have been searching on the internet for help, but I can't find a clear answer.
    Thanks in advance.

    1) authorize iTunes on the new machine for your iTunes store account(s)
    2) connect your device and right-click or control-click it in the iTunes Source list, then choose transfer purchases from the shortcut menu that appears.
    3) sync the device
    iTunes will wipe the iPhone but, since you transferred your purchases in the previous step, your content will be in your library and you can re-populate the iPhone with it.
    btw, purchased apps can be redownloaded over and over free of charge ...
    How to redownload purchased apps from the App Store
    ... and so can music and books
    http://www.apple.com/itunes/whats-new/

  • How do you get iTunes music from one computer to the other?

    I activated iCloud, home sharing on multiple computers and i still don't know how to share my music and movie files from itunes.

    Click here and pick the option which best fits your situation.
    (90747)

  • How to move a transport request from one client to the other

    Hi,
    I created a new transport request with a lot of elements (and also some modifications), but I made it in the "wrong" client on the system. Now I have the question if there is any possibility to change the client-relation of a  transport request via SE01 (or similar transaction). Copy and Paste of the element list isn't the optimal way, because there are also table contents in the transport request.
    Can you give me a hint?
    Thank you
    Kind regards
    Markus

    Yes you can change the traget client.
    Check the TR properties and set the taget client .

  • How to move an iDrum beat from one project to the other

    I have a project with an iDrum beat that I want to copy into another project file. I browsed the package contents and it only had Real Instrument .aif files. I didn't save the beat in iDrum. Can I just drag it over somehow?

    rsherid wrote:
    I have a project with an iDrum beat that I want to copy into another project
    copy it, then paste it

  • I have recently transferred data from my old Mac to my new one. The result was good, but I have 2 users now, whose data I want to merge into 1 single user, so to avoid having to switch from one user to the other to view and use certain files. How to do it

    I have recently transferred data from my old Mac to my new one. The result was good, but I have 2 users now, whose data I want to merge into 1 single user, so to avoid having to switch from one user to the other to view and use certain files. How to do it?

    Here's an easy way:
    Pick the user that you want to eliminate (making sure that the remaining user has administrator privileges) and move all of the data that you want to keep into the Shared folder. Reboot or log out and login to the user you want to keep. Copy all the data from the Shared folder into your account - placing it neatly in folders (Documents, Music, Movies, etc.).
    Once the data is moved, log into the account you want to delete just once more to make certain that you've grabbed all the data you want to keep. Log out and log back into your admin account and go to System Preferences>Users & Groups and delete the 'old' user.
    That should do it.
    Clinton

  • How can I move apps from one computer to the other?

    How can I move apps from one computer to the other?
    (preferably without iCloud)

    Backup your iTunes library to an external drive and onto the other computer
    http://support.apple.com/kb/ht1751

  • How do i copy stickies from one mac to the other

    how do i copy stickies from one mac to the other?
    or are they stored in a file i can just copy them over ? if so what is the file name path?
    thanks in advance

    yes, they are stored in the file /users/username/library/StickiesDatabase. just copy it over to the corresponding location on the new computer.

  • When I use Home sharing, I can see the library I want to copy, but when I highlight the library, the import button does not show up. Also, it will not let me drop and drag. How do I get music from one computer to the other computer?

    When I use Home Sharing, I can see the library I want to copy under Shared, but I can't get it save on the computer under the regular library. I go to edit and "select all" but there is no import button that is in the right hand corner. Also, it will not let me click and drag the music. How do I get it from one computer to the other?

    Since both computers are connected via the network, you could simply copy the ENTIRE iTunes folder from one computer to another via the network.
    If both computers are running Windows, use the Easy File Transfer Utility built into Windows to move iTunes and all other user media/data.

  • I have a new iMac and i created two libraries on iTunes. how do i copy songs from one library to the other?

    I have a new imac. I created two libraries, one for me, one for my kids. how do I copy songs from one library to the other library?

    Not easy unless you're just content with adding some files to the other as new files but lose playlists for those files, and playcount, and ratings, etc.  If you're okay with that, you can drag the media folder from one library to the other. If you use default settings and want to duplicate the media, just drag it. If you want to add the media but leave it where it is currently located, hold down the option key while dragging to the library window.
    Otherwise:
    PowerTunes - http://www.fatcatsoftware.com/powertunes/ (commercial software)
    syncOtunes - http://homepage.mac.com/oligrob/syncOtunes/syncOtunes.html

  • How do I transfer music from one iPhone to the other without using a laptop and will I be billed?

    How do I transfer music from one iPhone to the other without using a laptop and will I be billed?

    Download Past Purchases
    http://support.apple.com/kb/HT2519
    Or do you mean this...
    Old Phone to New Phone
    http://support.apple.com/kb/HT2109
    Also...
    It should be Noted that anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID

Maybe you are looking for

  • HT4356 How do you conver a Page document to PDF when there is no printer available

    I purchased a $400 printer last year..now I cannot use it with my IPAD3 because it has to be an Air Print printer. I need to convert my Page document to PDF and the only way to do that is to go to Print a document...but, when I get there it tells me

  • How do I get the orange firefox button to show up on the top left corner of my page?

    So, I've installed, and reinstalled the new Firefox 4. It seems like only half the features have shown up. For example, I don't have the orange firefox button in the top left corner. I also don't have the button for bookmarks. On every other machine

  • Sap abap hr query (top urgent)

    hello, i want to take the list of two fields of students last name i.e. field name is NACHN and first name field name is VORNA the table name both of is P1702 i have the screen. and i have to do the input of students id like from to, let me know how

  • Creating a progress tracker like Domino's Pizza website?

    Hi, I'm interested in creating a progress tracker using dreamweaver or another adobe product. I want to create a website that can display the progress of a product being made in real-time. Additionally, it would be helpful to create "lights" on the w

  • Photoshop to Photoshop Lightroom Export?

    I have Photoshop Extended CS5.1 and Photoshop Lighroom 3.4.1 running under Mac OS X 10.7.1. I also have a ton of photos I've scanned in that I'd like to take from Photoshop to Lightroom. I could make my edits, save a new file and then import that new