Basic Layout stuff (adding) and Clearing screens

Ok I have 2 problems I cannot figure out
1) I am using a gridlayout (6,1) inside a panel inside the southern border of a borderlayout. I have 2 textfields and 4 buttons added to the panel. I want the buttons and textfields to be a certain size and not the size of my applet. Any Help?? Can I add buttons and Textfields to specific pixels instead of on a layout???
2) My applet is actually a game. I have multiple classes and stuff and I need to clear objects at times to hide them so they are not visible. I know in VB there is a .visible() method. How do i make buttons, images, and textfields, invisible and visible????
Please help
Sam

(1)
Not all Layout managers repect the requested size.
When using GridLayout each cell in the Grid will be the same size - the size of the largest component added - and the other components expand to fill the available space.
You can position components absolutely by using a null Layout and then using the specific method - setPosition(x,y) or whatever it is. However, you can normally get the desired effect using the Layout Managers by adding Panels inside Panels.
GridbagLayout gives you a lot more flexibility but this is also more complicated to use.
Ideally, you should have a look at the Swing tutorial on using Layout Managers.
For the problem at hand however, I'd set the Panel holding your button's and textfield's to be a FlowLayout as this does respect the preferred component size:
// new Panel - components added left to right with centre alignment
JPanel myPanel = new JPanel (new FlowLayout(FlowLayout.CENTER));
JButton myButton = new JButton("CLICK");
// set size of new button
myButton.setPreferredSize(new Dimension(40,40));
JTextField myTextField = new JTectField(5);
// add to Panel
myPanel.add(myButton);
myPanel.add(myTextField);(2)
yourComponent.setVisible(boolean);

Similar Messages

  • How can I start anew with Photos and clear the (minimal) stuff it has uploaded

    I've about had it up to here with this new Photos scheme. I reorganised my Aperture libraries on both my iMac and MBA in preparation for this, delayed turning Photos on for a couple of days until I thought everything was ready based upon the limited advice that was out there, and then got stuck in an endless loop of "uploading" and "preparing" every time I opened Photos. There are 19,975 images in my Aperture library on the iMac. I was stuck at Uploading at anywhere between that number and 19,000 with no progress after hours of waiting. I tried all the tricks mentioned here including re booting, restarting the app, repairing/rebuilding the database, killing the "cloudd" process, etc.today Today when I restarted Photos, it now said I had 23,775 images to upload- 4000
    more than I have-and of course it got stuck there, like it has for the last week.
    I copied the previous Aperture library (pre Photos migration)back to my iMac and opened it in Aperture. Thankfully, all the photos I had taken on my iPhone this week during this Photos clusterphuck transition were in the Aperture Stream so I didn't lose any of those. I'm willing to give this whole thing one more shot. So  i need some advice. How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    <Re-Titled By Host>

    How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    It is hard to say from your post, why the migration did not succeed in your case.
    by "stuck on upload" do you mean, you opened the Aperture library in Photos, and Photos converted it to a Photo Library, and then the upload to iCloud Photo Library did hang?  Or did already the upgrade to the Photo Library fail?
    If you want the Aperture library to upload to iCloud Photo Library, it needs to be on a disk formatted MacOS Extended (Journaled) and the original image files must not be referenced. Referenced originals will not upload.
    Also, the upload may hang, if you do not have enough free iCloud storage, orr if one of the videos or photos in your library is in an unsupported format or corrupted.
    To start over, try to repair and rebuild the Aperture library before opening it in Photos. Try all Aperture Library First Aid options - starting with repairing the permissions.  (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual)
    If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    You will have to delete the photos that are already in icloud too; otherwise you are risking duplicates.
    Can you launch Photos at all?  If yes, delete all photos in Photos and empty the Recently Deleted album. Wait for the deletion to sync to iCloud. Then delete the Photos.photolibrary.

  • Downloaded a movie from iTunes to my iPad. 2 minutes into the movie it stopped and My Videos is stuck in black screen mode. So basically rented a movie and never watched it.

    Downloaded a movie from iTunes to my iPad. 2 minutes into the movie it stopped and My Videos is stuck in black screen mode. So basically rented a movie and never watched it.

    The EXACT same thing happened to me last night!  Rented a movie; it had barely started and then froze.  When I touch the video app icon, all I get is a blank, dimly lit screen.  None of the other videos I own will display either.  Was your problem ever resolved?

  • I have an ipod touch 8gb model number MA623LL. How do I install apps on my ipod? Is it capable of transferring/running apps? Why doesn't my ipod touch have the basic-beginning app on the beginning screen after i erased/wiped my ipod and started new?

    i have an ipod touch 8gb model number MA623LL. How do I install apps on my ipod? Is it capable of transferring/running apps? Why doesn't my ipod touch have the basic-beginning app on the beginning screen after i erased/wiped my ipod and started new?

    Googling shows that you have the 1G iPod.  For apps you need at least iOS 2. The iG can go as far os 3.1.3 that you get here:
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)
    Just be aware that there are presently not that many apps that work with a 1G with iOS 3.1.3

  • After having downloaded the free version of Maverick OS X, HD version, I haven`t got a clear screen anymore and even on my photos lots of scratches in different colours appear. It seems to me that something went wrong.

    Since I have downloaded the free version Maverick OS X, HD version, from the App Store, I haven`t got anymore a clear screen whenever I open a page. Scratches and stripes appear and this is especially annoying when I wanna have a look on my downloaded photos from my iPhone 5 S. Does anybody know a solution ? Maybe somebody is struggling with the same problem.

    I'm not sure what you mean by HD Version. There is only one Mavericks and I find nothing about HD.
    Perhaps you have the display resolution set wrong for your display.

  • Adding custom fields in Contract and PO screen

    Hi Experts
    I am trying to enhance contract and PO screen by creating structure Ci_bbp_hdr_ctr and Ci_bbp_hdr_po
    Now I am able to display the required fields on the screen.
    Is there any other way to do the same??
    I want to change the position of the fields, how to achieve that??
    and How to display drop down fields??
    Reg,
    Rajesh.

    Hi Rajesh,
    To add the customer fields please have a look at the following OSS Notes:
    Note 458591 - User-defined fields: Preparation and use
    Note 672960 - User-defined fields 2
    Also go through the following blog:
    /people/nanda.kondagunta/blog/2006/10/23/how-to-create-custom-fields-in-srm
    To display the customer field as drop-down list go through the below given thread:
    Re: How to display Customer Fields like a dropdown listbox ?
    The position of the customer fields depends on the order you added them in the Incluse structure as per the OSS Notes 458591& 672960. If you added a customer field first then it would appear first simlarly if you have added it at the end of the structure it will appear towards the end of the screen.
    Hope this helps.
    Thanks,
    Pradeep

  • Has Photoshop CS5 Extended added a "Behind" and "Clear" in MODE drop down box?

    Hi Guys,
    I am not sure what just happened with my PS. Was downloading and installing some custom patterns and brushes from the net last night. And when I went to try them out I noticed the drop down box had 2 new added effects ( Behind and Clear ) which I was not able to even access because they were not live. It is the drop down box which has the normal, dissolve, darken, multiply etc. etc. up on the top left hand bar. I was going to upload a picture but I keep getting a message saying this file is forbidden, even after I scaled the image down to the required fields. I was wondering if some one can help. I hope it wasn't a virus from the internet files I downloaded.
    Many thanks, Grace.

    They are brush blend modes.  To use you need to have the brush tool selected.  Open a new layer and paint with any colour.  Chose another colour and make the blend mode Behind.  I bet you know what will happen now? ;-)
    Clear works pretty much the same as the Eraser tool as far as I can tell.  Might need to actually read the manual to get more info on that.

  • Adding product cleared the topic and title !!!!

    adding product cleared the topic and title !!!!
    not good i had a big paragraph.

    anyone have any idea about this, it's very frustrating

  • My safari screen is greyed out, I checked and found a response to this question.  I went to settings and cleared history, cookies, and cache, java script is on and I restarted, screen is still grey, cant touch it to do a thing.  Help!

    my safari screen is greyed out, I checked and found a response to this question.  I went to settings and cleared history, cookies, and cache, java script is on and I restarted, screen is still grey, cant touch it to do a thing.  Help!

    That is usually the fix but try this now.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple logo appears - ignore the red slider - let go of the buttons. See if that helps.
    You can also try this - quit Safari. From the home screen - Double tap the home button and your recent apps appear the bottom. Tap and hold down on the Safari icon until it wiggles. Tap the minus sign in the upper left corner to close the app. Tap the home button twice. Restart the iPad.
    Message was edited by: Demo

  • What has the Apple support team done to the Top Sites screen? I just accepted an automatic update to be downloaded to my iMAC, and as a result of this "fix installation" the layout of the Top Sites screen has been terribly "destroyed"! What's the idea?

    What has the Apple support team done to the Top Sites screen? I just accepted an automatic update to be downloaded to my iMAC, and as a result of this "fix installation" the layout of the Top Sites screen has been terribly "destroyed"! What's the idea?

    If you are referring to the non-panorama , but rather the flat look, well that's what they did.
    You can give your opinion here:
    http://www.apple.com/feedback

  • [svn:osmf:] 14023: Updating OSMFPlayer to the changed layout APIs, adding a comment, and fixing MediaContainer from ignoring its constructor argument.

    Revision: 14023
    Revision: 14023
    Author:   [email protected]
    Date:     2010-02-07 07:54:38 -0800 (Sun, 07 Feb 2010)
    Log Message:
    Updating OSMFPlayer to the changed layout APIs, adding a comment, and fixing MediaContainer from ignoring its constructor argument.
    Modified Paths:
        osmf/trunk/apps/samples/framework/OSMFPlayer/src/OSMFPlayer.as
        osmf/trunk/framework/OSMF/org/osmf/containers/MediaContainer.as
        osmf/trunk/framework/OSMF/org/osmf/layout/LayoutTargetSprite.as

  • Printer message on computer says deleting print but will not clear screen and will nopt print

    my printer message says deleting for current print. but it will not clear screen and i cant print anything

    Hi @davecdavec6601,
    Welcome to the HP Forums!
    I understand that you cannot print, and I am happy to help!
    For further assistance, I will need to know some additional information:
    The Product/Model Number of your printer. Follow instructions in this link. Finding Your HP Product Model Number.
    If you are using a Windows or Mac Operating System, and the version number. To find the exact version, visit this link. Whatsmyos.
    If the printer is connected, Wireless, Ethernet, or USB.
    If the printer is able to make copies.
    If the power cable is plugged into a surge protector, or directly to the wall outlet. Issues when Connected to an Uninterruptible Power Supply/Power Strip/Surge Protector. This applies to Inkjet printers as well. 
    Please see this post, Want Good Answers? Ask Good Questions, by @Bob_Headrick, so you can get the most out of these forums.  
    Hope to hear from you soon, and thank you for posting!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • Clear screen in Dos AND Linux????

    Is there a way to clear screen (similar to C++ clrscr()) in Java? I badly need some help on this.
    Cheers
    Kaps.

    kapilaj: clrscr() and constrea.h do not seem part of ansi C++, and I've only seen them as a part of dos/windows libraries. The close counterpart to the iostream library in Java would be the java.io package, but in looking through the documentation for it, I was surprised to find no obvious method to do a screen clear. Though, given the platform specific nature of terminal output, this would perhaps be hard (or impossible?) to implement. One kluge that would work on windows and most unices would be to simply print 25 nextline characters.

  • I added an event to my calendar and the screen froze and will not go back to calendar home

    I added an event to my calendar and the screen froze and will not go back to calendar home

    Try a hard reset.  To do this, press and hold both the Sleep/Wake and Home buttons together long enough for the Apple logo to appear.
    B-rock

  • Best crystal clear screen protector? and best free apple bumper to get?

    What would be the best CRYSTAL CLEAR screen protector that is super clear and hardly notice its on there with PROTECTION from scratches? also whats the best bumper to get for free from the app?

    Don't use a screen cover, so no idea.
    As far as case goes, see this: http://www.ilounge.com/index.php/backstage/comments/apple-iphone-4-case-program- here-are-the-best-worst-picks/

Maybe you are looking for

  • What's wrong with the AU DC (again)?

    The AU CD is down again. It's been up and down a bit today, with slow responses and then no server response at all. The status page is not particularly helpful. This is becoming really annoying for our clients. Two just asked if they should relocate.

  • Update J2ME Apps (Updating Existing jar with latest updates)

    Hi , I am new to J2ME. I had created a jar(One J2ME App). I need to update the existing jar with some of my newly added & edited class file. I can do this for desktop apps "jar uf jar-file input-file(s)", there is an option to put all the updates in

  • How to stop thread ?

    Hi all, Could you tell me pls, how to stop a thread ? thanks in advance bye

  • Very poor customer service - manager hung up because he didn't want to help or it was almost 9pm EST

    Hello, Today I realized that even I have became victim of this hidden undisclosed charge which seems to be a SCAM and not treating customer fairly. I was charged $64.99 just for running a wire for TV which is on the other side of the wall in my house

  • Filter pane to affect multiple data providers

    Hi all, I have a filter pane and I need it to affect more then 1 DP. I saw that there will be a solution in which the selection will not apply automatically, but an apply button will be added so I'll be able to modify it, but this is still not suppor