Placing components without layout manager not working

Hey there, I am working on a java game version of pong which I have begun to try and do using Java Swing. The problem I am currently having is reposition the components in the main window part of the game which is were the user can start a new game or close the program. I having tried using the absolute positioning by setting the layout manager to null but then everything goes blank. I can't figure out why this is not working. Here is the code so far...
import javax.swing.*;
import java.awt.*;
public class SwingPractice extends JFrame
    private Container contents;
    private JLabel titleLabel;
    private JButton startGameButton;
    public SwingPractice()
        super("SwingPractice");       
        contents = getContentPane();
        contents.setLayout(null);
        this.getContentPane().setBackground(Color.BLUE);
        startGameButton = new JButton("Start Game");
        startGameButton.setFont(new Font("Visitor TT1 BRK", Font.PLAIN, 24));
        startGameButton.setForeground(Color.cyan);
        startGameButton.setBackground(Color.blue);       
        startGameButton.setBounds(350,350, 75, 75);
        titleLabel = new JLabel("The Amazing Ping Pong Game!!");
        titleLabel.setForeground(Color.cyan);
        titleLabel.setBackground(Color.blue);
        titleLabel.setOpaque(true);
        titleLabel.setFont(new Font("Visitor TT1 BRK", Font.PLAIN, 24));
        titleLabel.setBounds(0,350, 75, 75);
        contents.add(startGameButton);
        contents.add(titleLabel);
        setSize(700,350);
        setResizable(false);
        setVisible(true);
    /*private class SwingPracticeEvents implements ActionListener
    public static void main(String [] args)
        SwingPractice window = new SwingPractice();
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   Any other critiquing would be greatly appreciated. Thank you.
Edited by: 804210 on Oct 21, 2010 1:30 PM

804210 wrote:
Hey there, I am working on a java game version of pong which I have begun to try and do using Java Swing. The problem I am currently having is reposition the components in the main window part of the game which is were the user can start a new game or close the program. I having tried using the absolute positioning by setting the layout manager to nullDon't. Ever. Never. Well, mostly.
Read the tutorial chapter about [url http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html]Laying out components. It even features a section on absolute positioning - which you should skip reading, of course! :o)
And read this old Sun topic: http://forums.sun.com/thread.jspa?threadID=5411066
Edited by: jduprez on Oct 21, 2010 10:48 PM

Similar Messages

  • Planning layout is not working in CRM

    Hi Guru's,
    I have created one planning profile under one planning layout in BW. Then I had configured this pallning profile in CRM-TPM. When I m going to creat Trade Pramotion. The planning layout is not work.
    After puting a Planning Profile Grp. "Volume/Trade Spend" new tab will be appeared Its shows following error
    Error in planning Services
    Error Message count : 0001
    Attribute 0BPARTNER has not value
    It means 0BPARTNER infoobject have novalues. then I had entered Customer Master data in CRM with the help of CRM consultant, Then I have pulled the same data in BW. But still I am facing this Error.
    If you know about this error. Please guide me. I]ll reared to maximum points.
    Regards
    Manoj Kulkarni

    Hi Ravi,
    Hope you would have handled this issue.
    My problem is what ever the planning profile I had created in SEM BPS (BW System component version BW 7.,4) using BPS0 t-code, I am unable to retrieve the same in CRM system while trying to assign the same to the planning group.
    At CRM end, In the below navigation i.e SPRO->CRM->Define Transaction types-> created & then while assigning the Planning profile in SEM Planning tab, I am unable to retrieve the ones I had created in BW-BPC (BW 7.4).
    Could you pls let me know what I would be missing here.
    We are in very beginning stage i.e testing the connections & communications, yet to start the configuration of TPM in CRM.
    Thanks.

  • Layout adjustment not working with tables

    Hi all
    Why will layout adjustment not work with tables?
    I am trying to re-format from A4 landscape to A4 portrait.
    The text box containing the table will resize but not the table.
    Any clues why this might be, I don't want to manually resize every table in the document.
    Many thanks,
    Rob

    Thanks Jongware,
    Having resized the table and got the little red ovals, I tried various things like changing the font size etc but the best workaround I found was to select the table and change the cell inset value to 0, this got rid of all red ovals and I didn't need to change the font size.
    Cheers,
    Rob

  • Password Manager not working with any internet browsers

    I have Thinkvantage password manager installed (v. 3.20.0311.00) on my Thinkpad X201. I am running Windows 7 professional, 64 bit. Password Manager works for all programs except IE8 or Mozilla Firefox (eg. works for Outlook, works for iTunes, etc.). When browsing, the program simply never pops up. It worked previously, and I still have many saved website login details, but it never logs in for me any more and new sites do not activate the program.
    I have made sure that the add-on is enabled and I have checked the box next to "enable 3rd party browser extensions" in the advanced tab of internet options. I have also tried resetting internet explorer settings. As mentioned above, this in not only a problem with IE8; it also occurs with Firefox.
    Any help would be very much appreciated.
    Dr_Rap

    Same problem here. I just recieved mine (Win 7 pro 64 bit, X201 Multitouch) last week and password manager not working at all in ANY web browser. It recorded my .net password just fine, but i can't get it to work in IE8. Who pays this kind of money for something that doesnt work?
    Fix this Lenovo!

  • Password manager not work on new Chrome

    Hi!
    Chrome version 29.0.1547.57m. Password Manager not working...

    We notice password manager is broken by new chrome. 
    Dev is working on fix, please wait for new release of Password Manager to fix this issue.

  • Kaspersky password manager not working on fox 5

    kaspersky password manager not working on the new firefox 5

    Kasperski has finally released a patch that works fine with Firefox 4, 5 and 6, as well as with Google Chrome!!!!
    You can download the patch at the URL [http://support.kaspersky.com/faq/?qid=208284589 Firefox patch for Kaspersky Password Manager]
    You must follow the entire procedure as described by the Kasperski techs... I just tried it, as I had the same problem as you, and it works fine!!!!

  • After the updating firefox 5.0 the internet download manager not working (not compatible) can you explan why?

    After the updating fire fox 5.0 the internet download manager not working (not compatible) can you explain why?

    Add-on developers need to keep up with new versions of Firefox as they are released and update their product. Have you checked with IDM to see if they have an update for you to install? Or ask them when they are going to have an update ready for 5.0.
    Another thing you could do is to install FlashGot. <br />
    https://addons.mozilla.org/en-US/firefox/addon/flashgot/ <br />
    http://flashgot.net/ <br />
    The developer of Flashgot, Giorgio Maone, keeps his extensions compatible with versions of Firefox that are still in development - future release versions.

  • W7 64 BIT Password Manager not working

    Using CSS 8.3. Can use fingerprint to log into W7. But the Password Manager feature will no longer work.
    Known issue?
    I'm also dual booting with Vista 32 bit. In Vista it works fine. Could the problem be one BIOS chip since its hardware connected (I think) but 2 OS'?

    Same problem here. I just recieved mine (Win 7 pro 64 bit, X201 Multitouch) last week and password manager not working at all in ANY web browser. It recorded my .net password just fine, but i can't get it to work in IE8. Who pays this kind of money for something that doesnt work?
    Fix this Lenovo!

  • Hp file manager not working

    after updating hp slate 7voice tab from jellybean to kitkat the hp file manager not working.

    Hello, and Welcome to the HP Support Community!
    This is not HP's fault - this change was caused by Google.
    Perhaps this article can help explain how Google changed Android KitKat 4.4:
    KitKat and SD cards — what's fixed, what's broken and what's misunderstood.
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • Internet Download manager not working.

    Internet Download manager not working with latest version of Firefox.
    My Firefox keeps crashing regularly as wee. Any suggestions how to fix these two problems.

    Can you confirm the version of Firefox you're using? The information in this post suggests you're using Firefox 19. The latest version is 35.0.1.

  • Liquid Layout does not work with extreme long pages

    (Solution at the end)
    Hi there.
    I have a layout for iPad with a width of 1024 and variable height.
    I now need an alternative layout for iPad HD. So I try to use liquid layout to alternate my layout to 2048 width and height x 2.
    The maximum size in InDesign is 15552px. So I managed to get all my SD layouts below 7776px.
    to sum things up:
    iPad SD: 1024x7776
    transform into
    iPad HD: 2048x15552
    Problem is, in this case the option to scale everything automatically gets completely ignored.
    Another layout, which uses only text and no images, boxes or multimedia gets transformed correctly.
    Does anybody have a tip for me how I can work around it?
    Thanks in advance.
    p.s.: Adobe, please increase the maximum sizes for documents
    Solution:
    Aaaand I just got it. Specify a new preset for your document-sizes: 2048x15552. Now if you use the page tool just click the new (in my case) "iPad HD" and choose liquid layout: scale.
    Works like a charm

    I am using Automator to find files with the .pages
    extension and then copy them to another folder, which
    lists the copied Pages files by name but with Zero
    KB! The files will not open - error: the index.xml
    file is missing.
    Any ideas on how to get a Pages file to copy with
    Automator?
    Hi Kurt
    To answer the title of your message: no, Pages does not work with Automator.
    But that's not really what you're asking. You really want to know how to copy Pages documents using Automator.
    To help you we need to know what Actions you're using in Automator and the parameters you're using eg the Filter Finder Items action (using a pages file extension) and the Copy Finder Items actions. Pls let us know how you're doing this and we'll try to help.
    Thanks.

  • WAAS installed without Central Manager. not compressing traffic

    Hi,
    I installed 2 SRE modules in 2 ISR G2 router and configure them without Central Manager, but they are not doing compression, Traffic is going to Branch to Head Office but without compression.
    My configuration is similar to this link
    http://2and2is5.wordpress.com/2011/03/30/configuring-cisco-waas-on-a-sre/
    I want to compress http, exchange and cifs traffic.
    I don't have Central Manager, could WAAS works without Central Manager ?
    Can anyone help me with that.
    Thanks in Advanced.

    Hi Arslan
    WAAS requires a Central Manager however once they are setup it doesn;t technically require one in order to continue to to optimise traffic. If your WAAS environment is setup correctly and is intercepting the traffic http and CIFS should automatically been compressed with LZ compression. WAAS can accelerate Exchange however it depends on how your Exchange environment is setup and whether it is encrypted? If its encrypted via SSL you will need a WAAS Central manager to accelerate it.
    To check if you WAE's are running correctly type in "show cms info" on the WAAS and you will probably see your WAE is status is not online:
    WAE2#sh cms info
    Device registration information :
    Device Id                            = 3107921                            
    Device registered as                 = WAAS Application Engine            
    Current WAAS Central Manager         = ##.##.##.##                       
    Registered with WAAS Central Manager = ##.##.##.## 
    Status                               = Online                             
    Time of last config-sync             = Mon Sep 24 13:18:51 2012           
    CMS services information :
    Service cms_ce is running
    You can check the accelerator status with the below command:
    WAE2#sh accelerator
    Accelerator     Licensed        Config State    Operational State            
    cifs            Yes             Enabled         Running   
    epm             Yes             Enabled         Running   
    http            Yes             Enabled         Running   
    mapi            Yes             Enabled         Running   
    nfs             Yes             Enabled         Running   
    ssl             Yes             Enabled         Running   
    video           No              Disabled        Shutdown  

  • AU Manager not working!!!

    Hi all. First post and all, wondering if you guys can help me out....
    A few problems. I recently upgraded to Leopard, I was running Logic 8 on Tiger ab fab.
    Anyway, now it seems that after having upgraded to Leopard, my troubles are too many.
    Firstly: Logic has no plugins. not even the bog standard logic compressor, channel eq, let alone my 3rd party au's. I dont know what the **** to do.
    Secondly: the AU manager does not work in Logic. at all. I try running it and it does absolutely nada. it seems that now just opening mainstage, IT scans for au's, however, logic doesn't. what is the reason for this bizarre behaviour?!
    anyone.....? anything.....? i am trying to avoid the reinstall of OS and all that as i have just spent the last 2 days getting my system the way i want it (bar logic of course).
    thanks.
    A

    Hi Vocalchild,
    Well, first of all, that is not the default setting.
    2. What do you mean by froze? How long have you waited before force-quitting?
    Have you tried to delete prefs?
    3. "Startupdisk"/Library/Caches/com.apple.Components2.LocalCache.AudioComponents
    4. "Startupdisk"/Users/"You"/Library/Preferences/com.apple.logic.pro.cs and
    "Startupdisk"/Users/"You"/Library/Preferences/com.apple.logic.pro.plist
    5. Have you tried reinstalling Logic? Just the app, not the content.
    6. Your AU's should be here:
    /Library/Audio/Plug-Ins/Components or in "Startupdisk"/Users/"You"/Library/Audio/Plug-Ins/Components.
    7. At your *own risk*, try deleting these:
    "Startupdisk"/Library/Preferences/com.apple.audio.SystemSettings.plist
    "Startupdisk"/Library/Preferences/com.apple.audio.DeviceSettings.plist
    regards, Erik.

  • Layout variant not working

    Hi ,
      I have executed a report . I hide one column and saved the layout. The layout name comes on to the selection screen parameter which i have defined on the selection screen.
    PARAMETERS: p_vari LIKE disvariant-variant. " ALV Variant
    i have made the i_save = 'A' and is_default = 'x'. and also used other function modules reg. Variants.
    but if i select the layout variant in the selection screen and execute it is not working . the hidden column also coming on the output.
    But if the select the layout variant on the output of the report from the icon select layout it is working fine. the column which i have hidden is not coming. it is perfect. why it is not working when i select the variant in the selection screen.
    Regards,
    Rose.

    Hi,
    Please try this code
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      w_variant-report = sy-repid.
    * Function module to show the variant of a ALV report
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = w_variant
          i_save     = 'A'
        IMPORTING
          es_variant = w_kvariant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        p_vari = w_kvariant-variant.
      ENDIF.
    END-OF-SELECTION.
    MOVE w_variant TO w_kvariant.
        MOVE p_vari TO w_kvariant-variant.
        MOVE sy-repid TO w_kvariant-report.
    *   Function module to check the variant existence
        CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
          EXPORTING
            i_save     = w_save
          CHANGING
            cs_variant = w_kvariant.
        w_variant = w_kvariant.          
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = sy-repid
          i_callback_pf_status_set    = 'SET_PF_STATUS'
          i_callback_user_command     = 'USER_COMMAND'
          i_callback_html_top_of_page = 'HTML_HEADING'
          i_grid_title                = text-t06
          i_grid_settings             = wa_grid_set
          is_layout                   = wa_layout
          it_fieldcat                 = t_fieldcat
          i_save                      = 'X'
          is_variant                  = w_variant
          is_print                    = wa_print
        TABLES
          t_outtab                    = t_header
        EXCEPTIONS
          program_error               = 1
          OTHERS                      = 2.
      IF sy-subrc <> 0.
        CASE sy-subrc.
          WHEN 1. RAISE program_error.
          WHEN 2. RAISE others.
        ENDCASE.
      ENDIF.
    Regards
    Krishna
    Edited by: Krishna Gowrneni on Apr 17, 2009 5:27 PM

  • Copied layout is not working for Sales order item assinment block

    Hi Experts,
    I copied the standard componet BT115IT_SLS/items view layout  with custom role configuration key and worked fine.
    I have added one more field to the item view  with the same configuration and saved .When I opended the sales order in the WEB UI , The item assigment block is displaying with complete  BTADMINI context fileds and This is the issue.
    I have seen configured fields only in  the personalization and I have downloaded the items assigment block data to Execl.In the Execl sheet I can able to see the configured fields (availble fileds in the configuration tab in component workbemch) data only.
    But Items assignment block is displaying all the fileds (taking  from the context node BTADMINI).
    I have deleted existing customer configuration and again copied  from the standard layout.But I got the same issue.
    I have wriiten some code in the ON_NEW_FOCUS and commented the code.Still it not working.
    Please help me , where I have done the mistake and provide me some inputs.
    Thanks,
    Venkky

    Hi Experts,
    Solved isuues myself.
    The problem is inconsistency of BTAdminI context node . I have deleted the view enhancement and again enhanced the view .I copied the layout with customer role key and dispalyed expected layout.
    Thanks,
    Venkky

Maybe you are looking for