JMenu Bar does not show unless I resize the window

Hi, I have just a simple problem. I am trying to just have a blank JFrame with a JMenuBar at the top with the JMenu "File". I have the following code, but once I run the application it is just a blank frame with no Menus. Once I grab the frame and resize it with the mouse, it appears. What do I need to do to have the menu bar be shown once the application runs?
import javax.swing.*;
import java.awt.*;
class ProgramWindow extends JFrame
private JMenuBar jmb = new JMenuBar();
private JMenu file = new JMenu("File");
public ProgramWindow()
setSize(300, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
setJMenuBar(jmb);
jmb.add(fileMenu);
Container c = getContentPane();
c.setBackground(Color.lightGray);
c.setLayout(new BorderLayout());
setConentPane(c);
public class Program
public static void main (String[] args)
ProgramWindow pw = new ProgramWindow();
}

Normally you poop up and decorate frames/dialogs before you set them
visible. Otherwise you have to revalidate() them after you' ve added
some components to them. (resizing them does that for you as you have
noticed).
kind regards,
Jos

Similar Messages

  • Using firefox 14.0.1. Loading a link using right-click and "Open Link In New Window", results in new window opening but address bar does not show URL..

    Using firefox 14.0.1. Loading a link using right-click and "Open Link In New Window", results in new window opening but address bar does not show URL. However, if I right click on a link and select "Open Link In New Tab", the Tab shows URL in address bar. So it's working when it's a New Tab but not a New Window.

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • On windows 8.1 charms bar does not show up and the touch functionality is also degraded

    upgraded my elitepad 900 to windows 8.1 . after this the charms bar does not show up and the touch functionality is also degraded while playing games. i believe i need the latest synaptics gesture suite.  Cannot find it. Please help.

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial product. You can do this HERE.
    HP ElitePad 900 G1 Tablet Support
    TwoPointOh
    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" on the bottom to say “Thanks” for helping!

  • In Photoshop Element 9, when opening the Organise section, the top bar does not show File, etc.?

    Just reinstalled Photoshop Ele,ents 9 onto Windows 7.
    In the Editt part,on opening, all is well.  This clearly show the top bar where youcan call and enter from the file to work with items on your computer.
    However, on the Organise section, this to bar does not show at all, therefoere you are unable to do any work as you cannot import items from anywhere.
    How do I get this to work now.

    You should ensure your font/text size is 100% or 96 dpi in the Windows control panel or you may need to adjust the native screen resolution of your monitor. Alternatively try keyboard shortcuts to access the menus.
    File – Alt+f
    Edit – Alt+e
    Find - Alt+i
    View – Alt+v
    Window – Alt+w
    Help – Alt+h

  • Capacity bar does not show detail in itunes

    Capacity bar does not show detail in itunes 10 when iphone is connected via wifi
    when I connect via cable it corrects itself
    running os 5.01

    PLEEEEASE
    i bought Apple TV 2 days ago but i couldnt bind it to my i tune??? i tried everything , my apple TV doesnt show on my I tune ?? theu are on the sam WIFI network ( Time capsule) same account and both updated !!
    can anybody help me to solve this problem

  • The scroll bar does not show in my SaaS application.

    I have a spreadsheet application and the scroll bar does not show on FF4. I need the scroll bar to navigate the app.

    table is surround by panelStretchLayOut but I examine this and has no difference.
    scrollBar show for data under one milion records!!
    and here is my code:
    <af:popup id="t1DataPopup"
    binding="#{B1Bean.t1DataPopup}">
    <af:dialog id="d9"
    type="ok"
    affirmativeTextAndAccessKey="#{viewcontrollerBundle.okLabel}"
    title="#{bindings.R1.hints.label} : #{bindings.R1.inputValue}"
    inlineStyle="position: absolute; left: -410px; top: -200px;">
    <af:panelStretchLayout id="psl4" topHeight="30px"
    inlineStyle="width:800px; height:400.0px;">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:table value="#{bindings.s1Graph.collectionModel}"
    var="row"
    rows="#{bindings.s1Graph.rangeSize}"
    emptyText="#{bindings.s1Graph.viewable ? viewcontrollerBundle.noDataToDisplayMessage : viewcontrollerBundle.accessDeniedMessage}"
    fetchSize="#{bindings.s1Graph.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.s1GraphQuery.queryDescriptor}"
    queryListener="#{bindings.s1GraphQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.s1Graph.collectionModel.selectedRow}"
    rowSelection="single" id="t1"
    partialTriggers="::s1Graph ::s1BarGraph ::s1HoriBarGraph ::s1AreaGraph"
    autoHeightRows="-1">
    <af:column sortProperty="T1Stmp"
    filterable="true" sortable="true"
    headerText="#{bindings.s1Graph.hints.T1Stmp.label}"
    id="c94" align="center">
    <af:outputText value="#{row.T1Stmp}"
    id="ot139"/>
    </af:column>
    </af:table>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="end"/>
    <f:facet name="top">
    <af:panelGroupLayout id="pgl20">
    <af:commandButton text="#{viewcontrollerBundle.saveAsExcelCommandButtonLabel}"
    icon="/Images/excel.gif"
    id="cb9">
    <af:exportCollectionActionListener exportedId="t1"
    type="excelHTML"
    title="T1Data"/>
    </af:commandButton>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelStretchLayout>
    </af:dialog>
    </af:popup>
    and fetchsize=25
    Edited by: Mansoor on Jul 17, 2012 8:28 AM

  • Menu bar does not show on screen?

    Menu bar does not show on screen.

    I'll assume your profile is wrong (10.4.7?) and you are using Lion in full screen mode.  If so click the double arrows in the menu bar which should appeare if you mouse into the menu bar area.
    If that isn't the case then are you zoomed in?  Contol + fingler drag on mouse (or scroll wheel) zooms in or out (see Mouse preferences, Screen Zoom, look at the little movie).

  • I have Windows 8. The address bar does not show on firefox. How do I fix this?

    The address bar does not show. How do I get it to appear?

    * If the menu bar is hidden then press and hold the Alt key down, that should make the Menu bar appear. Make sure that you have the Navigation Toolbar and other toolbars visible: View > Toolbars .
    * If items are missing then see if you can find them in the View > Toolbars > Customize window.
    * If you see the item in the Customize window then drag it back from the Customize window to the Navigation toolbar.
    * If you do not see that item then click the Restore Default Set button in the View > Toolbars > Customize window.
    See also [[Back and forward or other toolbar buttons are missing]] and [[Customize navigation buttons like back, home, bookmarks and reload]] See http://kb.mozillazine.org/Toolbar_customization

  • I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts

    I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts.   All the instructions on synching start with "find your device in the device window".  But what if you have no device window?

    Missing "message" from above: The iPad "DGMTR" is synced with another iTunes library on DGMTR's MacBook Pro. Do you want to erase this iPad and sync with this iTunes library? An iPad can be synched with only one iTunes library at a time. Erasing and syncing replaces the contents of this iTunes library.
    I thought the libraries were the same.

  • HT4623 My ipod does not show update settings in the About section

    My ipod does not show update settings in the About section how can i  get the update ios5 in order to get facebook on my ipod how can i do this

    To update
    The Settings>General>Software Update comes with iOS 5 and later.
    Connect the iPod to your computer and update via iTunes as far as your iPod model allows
    iOS: How to update your iPhone, iPad, or iPod touch
    A 1G iPod can go to iOS 2.2 via iTunes and iOS 3.1.3 via
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)       
    https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/touchLegacyLandingPage
    A 2G to 4.2.1. Requires iTunes version 10.X. If a Mac it requires OSX 10.5.8 or later. With OSX 10.4.11 you can only go to iTunes 9.X which gets you as high as iOS 4.1
    A 3G to 5.1.1  Requires iTunes version 10.5 or later
    A 4G to 6  Requires iTunes version 10.7 or later. For a Mac, that requires a Mac with OSX 10.6.8 or later
    Identifying iPod models
    I suspect you have a 2G iPod. Those can only go to iOS 4.2.1.
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.

  • My Ipad does not show it is in the right city, My Ipad does not show it is in the right city, My Ipad does not show it is in the right city

    My ipad 2 does not show it is in the right city if I check it on mobile me...anyone else have that problem?

    At the time you check your iPads location through MobileMe, your iPad would need to have access to and be connected to the internet.

  • Visual nodes not updating unless I resize the application window

    I'm not sure what has happened here but I can add new nodes and use my app as normal but there is no longer any change on screen to indicate modified nodes until I resize the application window!
    Once i double click the top of the app window sure enough I can see the new nodes that were added.. this is very frustrating.. Any ideas what this could be?
    I went back to an older version of my app and it is occurring with that also so it isn't new changes to the app. Is my javafx broken somehow?

    This is really weird... I reinstalled java, javafx, and netbeans and it didn't rectify the problem immediately. After a few days I came back to netbeans and tried the application and it was working properly. Without changing anything.
    Now again, I shutdown and restarted the PC and have come back to netbeans and the application will not update moved objects on screen unless you resize the window!
    This is really crazy... I literally had this application working perfectly for several days before I shut down my PC (I usually just sleep the computer for days on end until it needs a reboot).
    Restarted PC and the old problem came back... I'm running Windows 7 64 bit... Am I going crazy? I don't feel this is code related!

  • Since the last upgrade, aol email does not download unless I touch the e-mail icon

    Since upgrading to 7.1.1 my email does not download unless I touch the e-mail icon.  This affects both the I-pad and the I-phone 5s

    I did the update on my iPad, but not on my phone and my AOL email hasn't been pushing to my phone or my iPad for the last couple of days. This started happening prior to me upgrading.  I hoped that it would at least help my iPad, but it hasn't.  Everything was fine until late Thurs or early Friday....May 1-May 2.  I called AOL yesterday, and they said that they would have upper level techs see if they can find out if it's a server problem, etc or anything else on their end, and get back to me.  Probably won't hear from them until Monday, at the earliest.  It happened very suddenly with my "push" nolonger working for me on both devices.

  • Top bar does not show for displaying PDFs in browser

    The top bar (the one that has: File-Edit-View-Documents-Tools-Window-Help) displays when the Preference is set to NOT display PDFs in my browser. But when I set the Preference to display PDFs in my browser, the top bar does not display.
    How can I get the top bar to display when my Preference is to display PDFs
    in my browser? That is the manner in which I use Acrobat Reader 90 percent of the time.
    I am using Acrobat Reader 9 which I just downloaded yesterday, my operating system is Windows XP (with Service Packs 1 and 2) and my browser is Internet Explorer.
    Can anyone here help me? Or is there a better place to get help on this?
    Milton Beychok

    Well the problem is that, in Windows, the menu bar is owned by the application. When you view the PDF in the browser, the browser owns the menu bar and chooses what to show. Hence it shows only the browser items and not the Reader menus. If you view it outside the browser, Reader is running stand-alone and shows it's menu items.
    I think, all you can do is show make sure the button bars you want are exposed by default.

  • My iphone 4 does not show the green bar moving when charging and sometimes the lightning bar does not show up.

    my iphone4 green battery bar does not move when charging. the lightning bolt is showing, but it is not moving and it shows onlu about 1/4 way charged. I have cut it off and back on and bought a new charger.

    does anyone know the answer

Maybe you are looking for

  • Oracle 10g Express Edition - Problem setting Remote Listener access

    Hi, I have finally managed to get my SUSE machine running Oracle XE. Now I wanted to add remote access to the listener by issuing the following statement (which is the same as described in the documentation) SQL> EXEC DBMS_XDB.SETLISTENERLOCALACCES(F

  • Data not appear in ME49

    SAP I have problem with RFQ comparision statement sheet ((ME49). I maintained the rate, tax, delevery date, etc. with Tcode ME47 for against all RFQ's. when I take report comparision statement thru Tcode ME49, report comes but in QTY and Rate comes w

  • How to test if db connection is available

    I have got the following code to conenct to database. package com.db; import java.util.*; import java.io.*; import java.sql.*; import javax.servlet.http.*; public class ConnectionManager implements HttpSessionBindingListener   private Connection conn

  • Link problems with Freestyle "About Me" page

    So I used the "about me" page of the Freestyle template to make a page for two teams of people. (See http://web.mac.com/bloodycool/iWeb/DACQuizzing/TheTeams.html) I have used the column of small pictures from the template to be a team portrait links.

  • There is no option to use the laptop without requiring a password?

    The machine contantly asks me for a password.  There is no option to use the laptop without requiring a password, such a nuisance. Like everyone else I really do not like Windows 8 either.  I'm returning this waste of money and going back to living w