How to get coordinates of components. PLEASE HELP ME URGENT!

Hi, I am trying to get the coordinates of my components that are tabbed pane buttons, buttons, text fields etc so I can place an image of a pointer under it that points to it and then under the image of the pointer I would put a label describing the button for example "press the tab to start". Then when I press tab1 the image of pointer image points to the next component and has a label under pointer.
Now I have tried using componenet.getX() and getY() and then set the values of the the image panel to use then the label panel so they be placed under the component, these panels are not using layout manager but absolute positioning. If the window is resized then the labels and image of pointer should also adjust. I have tried putting the label and arrow into a glasspane and now layerdpane as some people here suggested which when I do then add it to contentpane the main panel with the components is not there but the layerd pane is.
I am having huge difficulties with this and if someone can Please just tell me or even better give me an example code how to find out the coordinates of components so I can place my image of pointers and labels underneath them I will be very grateful of you. I am on a verge of giving up accomplish what I am doing and I am new to the swing framework. My progress to solve this has been very slow and frustrating. I just hope someone here can help.

I tried the both of codes given. But the code given by both the person i have not understand. And what they there code is doing. This is the code form my side if this example help u.
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
* Author Waheed-Ul-Haq ( BS(CS)-8 )
public class Samulation2
     JPanel pane;
     JLabel label1;
     JTextField entProcesfld;
     JButton buttCreat;
     JButton buttReslt;
     JLabel usrProcesID[];
     JTextField usrArivTam[];
     int processes;
     public JComponent createComponents()
     pane = new JPanel();
     pane.setLayout (null);     
     label1 = new JLabel();     //Label for to tell user to enter no of Processes.
     label1.setText("Enter the no. of Processes");
     pane.add(label1);
     label1.setBounds(20, 25, 150, label1.getPreferredSize().height);
     entProcesfld = new JTextField();     //TextField to enter no of processes.
     entProcesfld.setToolTipText("Enter the no of Processes.");
     pane.add(entProcesfld);
     entProcesfld.setBounds(180, 25, 100, entProcesfld.getPreferredSize().height);
     buttCreat = new JButton();          //Button to create the TextFields.
     buttCreat.setText("Create TextFields");
     pane.add(buttCreat);               //Adding cutton to Jpane.
     buttCreat.setBounds(new Rectangle(new Point(30, 60), buttCreat.getPreferredSize()));
     buttCreat.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                    buttCreatActionPerformed(e);
               } } );          //ActionListenr to Create the TextFields.
     pane.setPreferredSize(new Dimension(600,600));
     return pane;
     }     //-------END of Component createComponents()--------//
     private void buttCreatActionPerformed(ActionEvent e)     //Action to Create the TextFields.
               processes = Integer.parseInt (entProcesfld.getText ());
               JLabel Labproces = new JLabel();     //Label of Processes.
               Labproces.setText("Processes");
               pane.add(Labproces);
               Labproces.setBounds(new Rectangle(new Point(15, 105), Labproces.getPreferredSize()));
               JLabel labArivTam = new JLabel();     //Label of Arival time.
               labArivTam.setText("Arrial Time");
               pane.add(labArivTam);
               labArivTam.setBounds(new Rectangle(new Point(90, 105), labArivTam.getPreferredSize()));
               //----Creating Dynamic JLabels------//
               usrProcesID  = new JLabel[processes];     /* Makes an array */
               int yXis = 125;          //Variable for Y-axix of JLabel.
               for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
                usrProcesID[i] = new JLabel("P" + i);      /* Makes a JLabel at an array place */
                pane.add(usrProcesID);      /* Adds a JLabel (rather than an array) */
usrProcesID[i].setBounds(new Rectangle(new Point(28, yXis), usrProcesID[i].getPreferredSize()));
yXis = yXis + 25;     /* Increses the Y-axis to show JLabels. */
}     //EndFor     
//-------End Dynamic JLabels---------//               
               //-----Creating Dynamic Arival Time TextFields-----//
               usrArivTam = new JTextField[processes];          /* Makes an array */
               yXis = 125;          //Variable for Y-axix of JTextField.
               for(int i=0; i<processes; i++)      /* i takes each value from 0 to processes-1 */
usrArivTam[i] = new JTextField();     /* Makes a JTextField at an array place */
usrArivTam[i].setToolTipText("Enter Arival Time.");
pane.add(usrArivTam[i]);      /* Adds a JTestField (rather than an array) */
usrArivTam[i].setBounds(100, yXis, 35, usrArivTam[i].getPreferredSize().height);
yXis = yXis + 25;     /* Increses the Y-axis to show JTextFields. */
}     //EndFor     
//-----End Dynamic Arival Time TextFields.-----//
//----Calculating points for Label and textfields.
Point poi = new Point();
poi = usrArivTam[processes-1].getLocation ();     //Getting the location of the last text field of ArivalTime.
//-----Label for Average Waiting time.--------\\
JLabel averWaitLB = new JLabel();
averWaitLB.setText("Average Waiting Time");
          pane.add(averWaitLB);
          averWaitLB.setBounds(new Rectangle(new Point(30, (int)poi.getY()+50), averWaitLB.getPreferredSize()));
//-----TextField for Average Waiting Time.--------\\
JTextField averWaitTF = new JTextField();
averWaitTF.setText ("Hello");
averWaitTF.setEditable(false);
pane.add (averWaitTF);
averWaitTF.setBounds(190, (int)poi.getY()+50, 35, averWaitTF.getPreferredSize().height);
}     //------END of void buttResltActionPerformed(ActionEvent e)---------//
     private static void createAndShowGUI()
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("Priority Scheduling (Non-Preemptive)....");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Samulation2 application = new Samulation2();
//Create and set up the content pane.
JComponent components = application.createComponents ();
components.setOpaque (true);
int vertSB = ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
          int horzSB = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
          JScrollPane scrollPane = new JScrollPane(components, vertSB, horzSB);
scrollPane.setPreferredSize (new Dimension(720,455));
frame.getContentPane ().add (scrollPane,null);
//Display the window.
frame.pack();
frame.setVisible(true);
}     //------END Of void createAndShowGUI()--------//
     public static void main(String[] args)
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
     }     //---------End of main()----------------//
}     //--------END of class Samulation2----------//
If any body help me implementing the ScrollBars in this code. I am unable to use Scroll Bars with this code while using NULL layout. If any body tell me how to get the Size and set for the pane.

Similar Messages

  • I went to put music on my itunes from my ipod and it deleted most of my music off of it and i dont know how to get it back. PLEASE HELP ME. :-|

    i went to put music on my itunes from my ipod and it deleted most of my music off of it and i dont know how to get it back. PLEASE HELP ME. :-|     

    - Unsync/delete all music and resync
    To delete all music go to Settings>General>Usage>Storage>Music>Tap edit in upper right and then tap the minus sign by All Music
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes      
      - Restore to factory settings/new iOS device.                       
    If necessary, you can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Don't know the name of it but a toolbar at the top of the window has disappeared after I restarted Firefox. It contained add-ons such as Download Helper and I don't know how to get it back. Please help. Thanks!

    I don't know the name of it but a toolbar at the top of the window has disappeared after I restarted Firefox. It contained add-ons such as Download Helper and I don't know how to get it back. Please help. Thanks!
    EDIT: Sorry I meant the "Save Complete" add-on, not Download Helper.

    Be sure "Add-on Bar" is checked (click on "Add-on Bar" to check or un-check)
    *See --> https://support.mozilla.org/en-US/kb/Back%20and%20forward%20or%20other%20toolbar%20items%20are%20missing
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *'''''Adobe PDF Plug-In For Firefox and Netscape''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *'''''Shockwave Flash''''' (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • On iTunes when i plug my iphone in, the bar at the bottom with contains the information about the capacity of my iphone, it has a bar called 'other' which has 4GB. I don't know what is taking up that space or how to get rid of it. please help :)

    On iTunes when i plug my iphone in, the bar at the bottom with contains the information about the capacity of my iphone, it has a bar called 'other' which has 4GB. I don't know what is taking up that space or how to get rid of it. please help

    You can reduce the size to normal, which is about 1GB, by restoring the phone.
    Backing Up, updating, and restoring your iPhone and iPod touch software
    The size of this part can increase when something goes wrong during a sync, or some files can't be read anymore by iTunes.

  • I used to have the mailboxes window on my screen (left side) when writing an email. I want it back, but CANNOT figure how to get it back. Please help. Thanks

    Where are the mailboxes???
    The opening window has the list of incoming emails. The left column of the page has the Mailbox window with folders. Perfect.
    When I click Write - or Reply - or Forward, the window comes up with the write window... and my total address book - but NOT the Mailboxes. It was would come up until last week. And now I can't figure out how to add the mailboxes folder to the write/reply/forward screen.
    And from that screen, I cannot get back to the main screen to reference another email. Real hassle. Am sure there is an easy answer. Would live to hear it.

    The standard Thunderbird Write window is just that, a composition window. If you turn the Contact Sidebar on by pressing F9 then you can see your address book contacts down the left margin.
    If you had anything different it must have been from an add on that you installed. There is no guessing what you did there.

  • Events disappeared from my calendar and I need to know how to get them back. Please help!

    When I merged my calendar to iCloud all of my events that weren't repeated disappears and all the other events messed up. Is there a way to fix this, preferably not using itunes on the computer. Thank you!

    Synced photos can't be deleted directly on the device - instead they are deleted by moving/removing/de-selecting them from where they were synced from on your computer and then re-syncing.

  • I can't find my mac mail email folders I need to get to them. Please help.

    I use mac mail and had some folders in there to organize my emails. I clicked on my computer the other day to use the mouse and they disapeared. I have no clue where they are. I am pretty sure they aren't deleted because no ther confirmation came up making sure I wanted to delete anything. I beleive they are hidden somewhere but I can't figure out how to get them back. Please help I need info out of them.

    Disable your antivirus and firewall, and try again.

  • TS4605 Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Hi, I was working in WORD on a file containing huge data. My machine just hung up one day while working and now I seem to have lost the file how do I get it back.  Please HELP me.

    Well, iCloud has nothing to do with this.
    Do you have the built-in backup function Time Machine running on your Mac?
    See: http://support.apple.com/kb/ht1427

  • I have lost all my notes saved on my iphone after syncing it. and my default mailbox is gmail. notes were very important. and now i dont know how to get them back. can anyone help me out please? thanks in advance.

    i have lost all my notes saved on my iphone after syncing it. and my default mailbox is gmail. notes were very important. and now i dont know how to get them back. can anyone help me out please? thanks in advance.

    Try this ..
    On your Mac open System Preferences > iCloud
    Deselect the box next to:  Notes
    Then reselect it.
    Give iCloud a few minutes to re sync the data.
    Other than that, try Time Machine >  http://pondini.org/TM/15m.html

  • I just updated my iPod touch and all my pictures are gone!!! How do I get them back? Please help!!!

    I just updated my iPod touch 4th generation to iOS 6.0.1 and all my pictures are gone!!! Everything else is there but my pictures! How do I get them back? Please help!!!

    If the photos were i your iPod's Camera Roll album (taken by or saved to the iPod you can:
    - If your PhotoStream is on you can get the last 30 days worth back. See that topic here:
    iOS: Importing personal photos and videos from iOS devices to your computer
    - Or you can restore from backup if you backed up when the photos were on the iPod.
    If the photos were synced to the iPod then you have to get them from where you got them the first time.

  • How do I get PBS again?  Please help!!!

    I was able to get PBS when I first got Apple TV after putting in a code, but my cable company recently changed their channel lineup, and I can no longer get PBS on Apple TV.  I used to get PBS on channel 314 on my TV, but after speaking with my cable company, I now get it on channel 198, but I can't get anything at PBS on Apple TV. All I get when I go there is the "downloading circle" and nothing happens.  The cable company can't help, and I've written to PBS several times with no reply.  I thought maybe I could get a different code and start over, but I don't know how to do that.  Can anyone help, please.  PBS is one
    of the main reasons I bought Apple TV.  Thanks. 

    I don't know who vaszandrew is, but I (diamond2277) wrote How do I get PBS again?  Please help!!! 
    It got printed and I lost my page so I started over again, and the one above with my question showed             (dated May 2, 9:56 am) as if it were an answer to vasndrew.
    After I wrote, it occurred to me that maybe if I disconnect my Apple TV and reconnect it, I will get PBS, and it worked.  Now I don't need an answer.  Thanks to anyone who was going to answer!  I have to remember my usual answer to technical problems, UNPLUG, AND START AGAIN.

  • My ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    my ebay toolbar and the ebay logo that was in my system tray at the bottom have both disappeared when I installed FireFox??? How do I get them back? Please help.

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • HT1386 I keep getting an error messagwe when syncing: iphone cannot be synced. Aduplicate file name was specified. What does this mean? How do I fix it? Please help.

    I keep getting an error message when syncing:
    iphone cannot be synced. A duplicate file name was specified.
    What does this mean? How do I fix it? Please help.

    any idea how to fix this

  • After upgradataion ,In testing phase- after search ,in result view we are getting some unwanted data ' +++++" should be added in Name .how to remove it.can you please help.

    Hi Team,
    After upgradataion ,In testing phase- after search ,in result view we are getting some unwanted data ' +++++" should be added in Name .how to remove it.can you please help.
    I want to remove ++++ in that column.

    Hi Kalpana,
    Please provide additional information for community users to relate this issue. Info like versions (old & new), the object which has this problem or component/view name will be useful to get the answers.
    Regards,
    Shobhit

  • I can't open Safari. It keeps giving an alert that says, "Suspicious Activity might have been detected." How do I fix this?Please help. thanks!

    Safari won't work. It flashes an alert. Alert says that a Suspicious Activity Might Have been Detected. Major Security Issue. How do i fix this? Please help. Thanks!

    You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

Maybe you are looking for

  • How do i prevent iCal from rearranging my calendars?

    I use iCal to manage a lot of calendars (near 20), I'd like to keep the related ones close together.  Unfortnately apple did away with the calendar groups, so that's just left me with one long list.  The pain isn't from the long list, but rather that

  • BI - Client copy 000, 001 or neither

    After install SAP Netweaver 7.0 BI ABAP+JAVA what shoud we do about client? In BW we can't have more than one client so I think this is the same for BI. If the system start with two clients (000 and 001), should we do a client copy? If yes, which of

  • Form size increases with F4 help

    Hello All, I am facing a performance issue in an interactive form. We have developed an adobe form and linked it to portal through WebDynpro. We have around 10 fields with F4 help on the screen. We achieved the F4 help with a push button next to the

  • Next Row in SMARTFORM

    hi all am printing a line in smartform with field GS_it_KOND_W-vtext but displaying the first line in that field..but my requirement is i need only second line to be printed.please pass on the code...like how can i print the line that is der in the n

  • Selection tool malfunction

    Hello. I have been using illustrator CS3 with no problems, but all of the sudden, neither of the selection tools will allow me to scale anything. what is the deal?! Any input would be greatly appreciated! Thanks!