Help me find a way

I think I just F'd myself and here is why. I was trying to create a class that would create JComponents for me and then just return that panel they were added to whelp. I got to thinking if I do that and then return the Panel then how do I access the components once that panel is returned if I created them as follows... if you look at the for loop that is where I create and then add my components to the panel. Someone please tell me there is a way to access these components once the panel is returned to check their values. Give me some options as what other way to approach this please. Additionallly, I dont' believe I can do this but I thought I would ask anyways. Once a variable is created is there a way to rename the variable within your code. So if I created JLabels j1, j2, j3...with the text "temp1", "temp2", "temp3". Can they be renamed to ... "txtTemp1", "txtTemp2", "txtTemp3"... within a for loop? Gosh I am so stupid I didn't think of this before I created these stupid functions. IDEAS?
     private static JPanel makeVerticalTextEntry(String title, int rows, int cols,
               String[] labelText, Dimension[] dims){
          //Create Objects
          JPanel pnl = new JPanel();
          GridBagLayout gbl = new GridBagLayout();
          GridBagConstraints gbc = new GridBagConstraints();
          pnl.setLayout(gbl);
          JTextField textField;
          //prevent Error for inccor number of arguments
          int numOfComponents = 0;
          if(rows == 1){
               numOfComponents = cols;
          }else if(cols == 1){
               numOfComponents = rows;
          }else{
               numOfComponents = labelText.length;
          if(cols == 0){ cols = 1;}
          if(rows == 0){ rows = 1;}
          //set constraints
          gbc.anchor = GridBagConstraints.CENTER;
          gbc.fill = GridBagConstraints.BOTH;
          //create components
          JComponent[] comps = new JComponent[numOfComponents];
          int index = 0;
          for(int row = 0; row < rows*2;row++)
               for(int col = 0; col < cols; col++, index++){
                    if(index < labelText.length){
                         comps[index] = new JLabel(labelText[index]);
                         textField = new JTextField("");
                         setMinAndPreferredSizes(textField, dims[index]);
                         gbc.anchor = GridBagConstraints.LINE_START;
                         gbc.insets = new Insets(0,10,0,0);
                         addComponent(pnl, comps[index] ,gbl, gbc, row, col, 1, 1);
                         gbc.insets = new Insets(0,10,20,10);
                         addComponent(pnl, textField, gbl, gbc, row+1, col, 1, 1);
               row++;
          //Set Panel Border
          setTitledEtchedBorder(pnl, title);
          //Set panel size
          Dimension radioBtnSize = comps[0].getPreferredSize();
          Dimension size = getWidestComponentSize(comps);
          int height = (numOfComponents * (radioBtnSize.height+10)+10);
          int width = (size.width+30) * cols;
          return pnl;

crosspost... sorry guyz... http://forum.java.sun.com/thread.jsp?forum=31&thread=556135

Similar Messages

  • Stolen ipod, help me find a way to retrieve it pleas

    somebody stole my ipod and i do not have the mobleme app on my ipod. is there another way to locate my ipod? i do have a weather and socal newworking app on my ipod. can i use that to locate it or no? i have no idea what to do right now pleas help me out

    i do not have the mobleme app on my ipod.
    Sorry, buy a new iPod Touch.

  • Can someone help me find a way to send RAW photos to Skydrive/Onedrive retaining their original file designation, i.e. NEF?

    I can obtain RAW files (NEF) from my camera.  I can then upload them to my computer and keep their RAW format. All of this is done through the cords with the iPad. However I am unable to load any of my photos up to any 'cloud' service.  The iPad converts all of them to some type of JPG file.  Is there a method or app that will help this process?  My goal is to protect my RAW images until I can do something with them. This includes the iPad for initial copy and I was hoping to use a cloud service for an additional copy.

    Both replies help to understand the restrictions of the iPad. JimHdk seemed to be a better technical reason for this issue.  The reality is I am not looking for more explanations as to 'why not'.  Is there a way around this?  I have read about a couple of apps that handle RAW files better.  But I am not sure if they will facilitate an export of the RAW file to any of the cloud services.  When I upload pics from my camera, they show up in 'camera roll' not iPhoto. If I use iPhoto the whole process is nothing but JPG.  I have to assume then the pics when then uploaded to my PC is acquiring them from 'camera roll' which leaves a collection of files in their original file format.

  • Heres the deal my cuzin stold my ipods charger(the one to download music and charge in a usb port)well i found it in her room and she says its hers (but its not!) is thier a way to prove that the charger is mine ?? please help me find a way to prove it!

    like i said my cusin stold my charger and says its hers when i know its mine but is thier a way i can prove it to her? please help:( my ipod is dead ever scence and i want it back!

    i thought about going the same route you did, but when I started looking at the prices of everything, I decided it was a better idea to just get a new stereo that can play and charge my iPhone.
    After a lot of comparing, looking and price checking, I decided to go with the Alpine IDA-X100. This is a media player only device (no cd player built in) and it has been great. It has an awesome interface and dial setup that let's you go through your music just as if it were on an iPod. It even has a small color screen that displays the album artwork for you. My car has a factory BOSE system in it and the Alpine head unit even managed to improve the sound quality. Go see you local alpine dealer (or best buy) and check it out. The supplied cable charges the phone and plays music too. Your iPhone will give you an error message when you plug it in, saying that the accessory was not designed for iPhone, but if you just click no it works great.

  • Help me find a way for writing  code

    Hi ,
    I have to write a code for the following task.
    Suppose a Table with 9*9 i.e 9 rows and 9 columns, Now i have to write code to pick the data from the 5th row 5th column and then 9th row 9th column.
    Please help me out.
    Regards,
    Santosh Kotra.

    Hi santosh,
    1.  ASSIGN COMPONENET 5 OF STRUCTURE WA_TAB TO <FS_ANY>.
      It means, that,
       strucuter/internal table WA_TAB
      has many fields,
       out of that,
       pick up the 5th field
       and assign it to field-symbols <FS_ANY>
    (now <fs_any> POINTS to the fifth field)
    2. Just copy paste this code in new program.
       (u will get the TASTE of it)
    3.
    REPORT abc.
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    field-symbols : <f> type any.
    SELECT  * FROM t001
    INTO TABLE t001.
    loop at t001.
    assign component 3 of structure t001 to <f>.
    write :/ <f>.
    endloop.
    regards,
    amit m.

  • Posted fixes do not help me find any way to show remote content. updated to 31.4 still not able. Any surefire fixes known?

    I have tried disabled add ons. changing security settings to "Allow all remote content", exceptions, etc. I have updated to 31.4. I can not make any of the recommended fixes work. Before I give up and try a new program can anyone PLEASE suggest anything new. Thanks

    Your best bet is try windows safe mode with networking. I have seen anti virus programs and some firewalls block remote images. They will not be able to do that in safe mode, so trying it is a good diagnostic.

  • PLEASE help me find a way to have a DESKTOP EXTENSION with Apple TV

    I dont want to have HDMI cord and I do not want just mirroring.
    thanx

    I tried Airparrot and its so slow... I end up doing mirroring and have 2 computers on. One for watching movies another to work or browse.

  • Can someone help me find a way to import my bookmarks into Firefox 4.0?

    I've recently suffered a computer crash. I had everything saved on an external hard drive, and now I'm trying to import the places.sqlite that supposedly holds the bookmarks into Firefox. Firefox refuses to recognize this file. I have seen this question posted many times, but no good answer to it. This is an easy drag and drop task for IE. Why can the same not be said for Firefox?

    Unfortunately, yes I did read that article. I tried importing the places.sqlite file from the Library. The places.sqlite file wouldn't even show up so I could select it when I went to import it. I also tried dragging and dropping it into the right place, but the bookmarks wouldn't show when I restarted Firefox. I've wasted hours on this, and I'm pretty frustrated. I don't know what the problem is. I've seen other posts about this same problem, but I haven't seen anyone say why the places.sqlite file refuses to import.

  • Cannot find a way to redeem my old pre 29 recovery key.

    I have a recovery key.
    There is no option to add a device other than a new one with nothing on it.
    This update seems to have taken away features and my years worth of bookmarks seemingly thrown out the window with the "new" sync system.
    This is absolutely frustrating, I have been looking for answers for hours now.
    It should not be this difficult. Help me find a way to recover all my important information, please.
    (This was a bad time for my computers hard drive to fail.....)

    Firefox 29 and later have a new Sync version that use a Firefox account and only use the name and password and no longer use a separate Sync (recovery) key (the Sync key is automatically derived from the password of the Firefox account).
    The new Sync version is completely different from the version that was previously used and you need to install a Firefox 29 or later version on all connected devices.<br />
    You can enter the name and password of the Mozilla account on other devices that have a Firefox 29 or later version to add extra devices and you now longer can use a pairing key to pair a new device although this might be possible again in a future version of Sync if they decide to re-add this feature.
    *https://support.mozilla.org/kb/how-to-update-to-the-new-firefox-sync
    *https://wiki.mozilla.org/Identity/Firefox-Accounts

  • Using iPod location services to find my way round new places

    I  like to use location services with map apps (such as OffMaps and MapsWithMe) to help me find my way around new places.
    I understand that the information  ipod uses for location services,  the positions of various wifi transmitters,  is stored in an Apple database and that the location result is likely to be very approximate.  My problem is that I  cant figure out how and when the relevant data arrives in my ipod.  Typically it seems that when in a new town,  during my first wander round the place, the ipod does not know where it is -  locations will not be shown on these map apps.  On subsequent travels through the town iPod does seem to know where it is and displays its location on the maps quite nicely.  (But by then of course I  too know my way around and so don't need theiPod;s assistance so much to help figure out where I am.) 
    So my questions are
    1) At what point does the ipod get to store the crucial location information?  I'm wondering for instance whether the ipod remembers the SSIDs  as it encounters them, but only learns about their locations when it  is next connected to the  internet?
    2) I'd like to know how much of this information the iPod can remember and for how long is it remembered.  (If I go back to a place visited last year will any of the previously "learnt"  locations be remembered by the iPod. I may well have forgotten my way round the place by then and the iPod's help would be useful)
    3) Is it possible to "teach"  the ipod about  known wifi locations in a particular geographical area before visiting the area.  That would be a tremendous boon to me.

    Good questions. However, I have never seen or heard about any information from Apple about how the iPod (and wifi-only iPad) really determine location.  I am waiting for answers from other users.

  • Please help to find my iphone,tks!

    Respect of the personnel of the service:
          hello
          Someone had stolen my iphone5S, heard that can be traced to the position of the mobile phone, please help to find a way to find, thank you very much! If you can find, I will try my best to publicity for your company.
    Here is my cell phone information.
    Silver 16 g.
    IOS 7.0.1
    The 2014-7-10 night - 20:50 shall lie between longhua in shenzhen was TouShou when culture square dance.

    No one here can help you.
    Use this article: What to do if your iOS device is lost or stolen - Apple Support

  • I have 2 screens at work and 1 screen at home. I was working on a power point presentation on 2 monitors. My window is now "stuck" when I Power Point. I cannot drag it back to a display or find any way to move it back into my view. Help!!!

    I have 2 screens at work and 1 screen at home. I was working on a power point presentation on 2 monitors with the presentation on monitor externally hooked up to my computer. My window is now "stuck" when I open Power Point. I cannot drag it back to a display or find any way to move it back into my view. Help!!!

    Here is what worked for me:
      My usb hub, being usb2, was too fast. I moved the wire to a usb port directory on my pc. That is a usb1 port which is slow enough to run your snyc.

  • Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Morning DeeHutton,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Best of luck,
    Mario

  • HT204120 My iPhone 5s is stuck with 3948 photos (shown on the iTunes storage bar) on and I can not find a way to delete them all! It's very annoying as it takes up 6.54 GB of space and leaves me no room to add films, music...etc on to it. Please help me!!

    My iPhone 5s (16GB) is stuck with 3948 photos (shown on the iTunes storage bar) on and I can not find a way to delete them all! It's very annoying as it takes up 6.54 GB of space and leaves me no room to add films, music...etc on to it. Please help me!!! I have already tried the numerous articles Apple have sent my way and I am still having no luck.I'd be eternally grateful if anyone could find a solution for me as this has been a problem for almost a year. Thank you.

    If they were put there via iTunes sync process, then simply untick the Music box before syncing again.

  • I want to use icloud on my macbook and cant because I am using OSX10.6.8 - I want to upgrade this but I cant upgrade to mountain lion as my mac does not support this - cannot find a way to go to Version 10.7.4 which i understand supports icloud - help

    want to use icloud on my macbook and cant because I am using OSX10.6.8 - I want to upgrade this but I cant upgrade to mountain lion as my mac does not support this - cannot find a way to go to Version 10.7.4 which i understand supports icloud - help to do this please

    If you purchased Lion for your iMac, just log into the Mac App Store from your MacBook using the Apple ID under which you purchased Lion and go to the Purchases page. You will be able to download and install Lion there. 
    searching the internet i found a link to upgrtade to 10.7
    The only place you get get Lion is from the Mac App Store. If you found some other site, that was an illegal copy and almost certainly tied to someone else's Apple ID and hence unusable by you. If the link was just to the Mac App Store, see above.
    As to the problem with synchronization to iCloud, that's not a 10.6 question, so I'd suggest you take up that specific issue in either the Lion or iCloud forums, providing full details, and someone there can probably help you sort things out.
    Regards.

Maybe you are looking for