Menu - why he no show  - eh?

Hi , does any one hav any ideas why the menu doesnt come down with the menu item on it with this code ?
any help would be gratefully reieved .. . .
public class Sketcher extends JFrame {
     private Canvas canvas;                              // The canvas to sketch on
     // Constructor for Sketcher class
     public Sketcher () {
          setSize(500, 500);                              // Set size of canvas
          setTitle("Sketch Pad");
          canvas = new Canvas();                         // Make canvas to draw in
          canvas.setBackground(Color.white);
          getContentPane().add(canvas, "Center");                         // and put it in the window
     public static void main (String[] args) {
          Sketcher f = new Sketcher();               // Fire constructor to make new Sketcher object
          MouseWatcher mw = new MouseWatcher();     // Wire up a mouse watcher listener
          f.canvas.addMouseListener(mw);               // listen for mouse events
          f.canvas.addMouseMotionListener(mw);               // listen for mouse motion
          f.show();     // make sketcher object window visible to user
          JMenuBar blackMenuBar = new JMenuBar();
        blackMenuBar.setOpaque(true);
        blackMenuBar.setBackground(Color.black);
        blackMenuBar.setPreferredSize(new Dimension(200, 20));
          f.setJMenuBar(blackMenuBar);
          JMenu menu = new JMenu("Menu");
          menu.setMnemonic(KeyEvent.VK_M);
          menu.getAccessibleContext().setAccessibleDescription("Main Menu");
          blackMenuBar.add(menu);
          //a group of JMenuItems
          JMenuItem menuItem1 = new JMenuItem("Clear",KeyEvent.VK_T);
          menuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.ALT_MASK));
          menuItem1.getAccessibleContext().setAccessibleDescription("Clear all Rectangles");
          menu.add(menuItem1);
          f.pack();
          f.setVisible(true);
          f.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
                    System.exit(0);
}cheers

I'm not exactly sure why (don't know much about Canvases), but it's something to do with the Canvas. If you take your code and just put a panel with a label in it instead of the Canvas, the menu works fine. Perhaps it's something about how the Canvas is painted? Maybe it never allows something to be drawn over it??

Similar Messages

  • Why is zero showing as a negative value?

    Does anyone know why zero is showing as a negative value?

    Hi Neil,
    Not really a bug, just a limitation of the mathematics involved.
    You're entering the numbers as base 10 numerals. Computers work in base 2, so before any calculation is done, each number must be converted to its base 2 representation.
    All of the calculations are done in base 2, then the results are presented as base 10, rounded to whatever precision you have set (or the defaut precision for currency amounts—to the nearer hundredth of the base unit). What you see is a rounded value, but what is actually in the cell is the result of the calculation, including the rounding errors inherent in the process.
    Those errors arise from a simple fact: Not all numbers in base 10 can be expressed exacty in base 2. (Not all numbers can be expressed exactly in base 10 either, but that's a different discussion.) Expression of numbers in the math underlying Numbers is accurate to 15 places (base 10), regardless of which side of the decimal point those places occur.
    Each of the "zeros" in your sums involves several pieces of data in the sum, not all of which can be expressed exactly in base 2. In two of the sums, the errors (if any) cancel out and there is no difference between the sum expressed to two decimal places and the same sum expressed to 15 digits. In the other three, this is not true, as can be seen below.
    The image is of your test table. Columns A, B, and C have been reduced i width, all non-sum rows have been hidden to reduce the image size, and the SUM cells have been set to show 30 places (the maximum permited in Numbers) after the decimal to ensure that all significant places are shown, and that the decimal points are lined up for easy comparison.
    Note that three of the results differ from their displayed (two decimal place) values. The largest difference is in the third value, the smallest in the forth. The absolute difference between expected and actual result in the third of these lies between the other two, but is more noticeable because the result is less than zero and carries the - sign because of that. The minus sign is not "inserted" (randomly) by the software; it's there for the same reason there's a minus sign in the cell containing -103.31 is in that cell: the value in the cell is negative.
    "If I replace the cells containing the duplicates eg. £269.57, £90.11 & £103.31 with numbers manually added together £539.14, £180.22, £206.62. - the software doesn't insert the negative."
    Nor does it "insert the negative" in the first cell displaying a "zero" result, or the cell displaying a 26.04 result. Replacing those six numbers with six (or three) others changes the translation errors for each of these pieces of the sum, and that changes the sum itself. In this case the cumulative error moved the result from being 'smaller' than expected to 'larger' than expected. The result is now slightly larger than zero, so the minus sign is not needed or appropriate.
    Here are two further examples. The sum shown is the one in row 130. The data is the same as in the original table except for rows 126 and 127.
    Original values:
    Two occurrences of -90.11 replaced with a 0 and -180.22 produced this change in the result. Still negative, so the minus sign wi still be there.
    Two occurrences of -90.11 replaced with -90.10 and 90.12:
    A surprise! The actual value is zero (to the limits of precision of the underlying math).
    But that's not (for the usual user) a predictable result.
    Depending what you are doing with the results, you may want to do the rounding proposed by Wayne. This will change the actual vaue in the cell to the displayed value ( 0.00), and will remove the minus sign.
    It's not a bug—Numbers follows ISO standards in its math—but you may wish to Provide Numbers Feedback to Apple regarding your (and others) user expectations. You'll find an item with that name in the Numbers menu in Numbers.
    Regards,
    Barry

  • Why PSA data show red status when opened but green on PSA page?

    Run RSA1 -> click PSA to open PSA page, locate one infosource and find the PSA under it, find the status column shows it's green, but when opening it, find the 1st column shows red for each row.  How does the inconsitance occur?
    BTW, if we open the infopackage monitor for the above one, find a weird thing is that each request get two consecutive processes running with a circle of red ball and green ball in the left frame.  Double click one of them, in the right frame and click the monitor Status tab, the msg window is as following (in between two dashed lines below):
    Incorrect data records - error requests (total status GREEN)
    Diagnosis
    Data records were recognized as incorrect.
    System response
    The valid records were updated in the data target and can be used in reporting.
    The incorrect records were not written to the data target, but were posted retractively under a new request number in the PSA.
    Procedure
    Check the data in the error requests, correct the errors, and post the error requests.
    Sounds like the data failed to uploaded to data target due to error in PSA, but why the status show green in somewhere?   And if clicking the Details tab, all show green!  Weird!
    Thanks

    Hi Kevin,
    In your InfoPackage Update tab, click the Error Handling button. It seems that the Valid records update, request green option is chosen. This is why you see the green request and some error records.
    This means that the corect reocrds were loaded and are available for reporting, but the incorrect ones were left behind. This is used to check the erro records separatelt so that they do not disrupt the entire data load.
    Hope this helps...

  • Why metadata index shows up when i plug my ipod into the computer in itunes and how to avoid metadata index showing up it will not allow me to eject from itunes

    why metadata index shows up when i plug my ipod into the computer  in itunes and it will not allow me to eject my ipod from itunes

    Hi donfrommars,
    Welcome to the Apple Support Communities!
    Please use the following article for information and instruction on deleting the U2 album from your devices and account.
    Remove iTunes gift album "Songs of Innocence" from your iTunes music library and purchases
    Have a great day,
    Joe

  • Menu and Buttons not showing up!?!

    OK. I was trying to burn a iDVD project on my dual G5 desktop w/iDVD5. I would get "there's an error while rendering". After fiddling with it for a day and getting no where, I switched to my laptop (G4/1.25ghz/10.4.8) with iDVD6.0.3. I started to re-assemble the project and the Themes button appears with the themes, the Media button appears with the media, but both the Menu and Buttons buttons show up with nothing but a empty white area! I need to reposition some buttons, but I can't.
    Please help.

    This frequently helps solve some problems. Quit iDVD. Search for the file named com.apple.iDVD.plist and trash it. (A new one will be created next launch of iDVD.) Or look in: User/Library/Preferences. This may solve project loading errors too. Restart and use Disk Utility to Repair Permissions.
    You'll need to reset some Preferences.

  • Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file bu

    Every time I open a pdf file which includes a javascript, a dialogue box pops up. I have a question why 'Do not show this message again' is not working even I checked on the checkbox. It should block the dialogue next time when I open the same pdf file but not working. What is the matter and how can I deal with it?

    I am trying it on Adobe Acrobat Reader 9.2.1. Tried to fix Hex code, and also tried 'edit-preference-trust manager'. I focusing on Adobe registries but still couldn't fix the problem.

  • Why does firefox show up as a plugin on volume mixer?

    Why does firefox show up as a plugin on volume mixer? After updating a flash plugin into firefox (when it had requested me to update it), it no longer shows up as firefox in volume mixer. It now shows up as some plugin icon. I really don't understand this, and wish it to be the firefox icon again. What is going on and what happened? It names itself "Plugin Container For Firefox" What does that mean? It has been this way ever since, and nothing I have done has fixed this. Restarting, refreshing, reinstalling, clearing cache, etc. Can anyone think of something please? :(
    == This happened ==
    Every time Firefox opened
    == This happened just a couple days ago (june 25, 2010 exactly)

    I have this, but my volume on firefox doesnt work at all

  • Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Just installed mountain Lion. Viewing a pdf sent to me using preview and some colors are appearing BLACK, however when I view the same PDF in Acrobat they are perfect and what they are suppose to be. WHY would PREVIEW showing a different color?

    Here's what I've found on the issue:
    Pantone color definitions have changed (coinciding with CS6) — they are now "Pantone+" (I think that's what they're called). The "+" apparently means they're now LAB colors. Lab colors are not properly displayed in Preview (or in Finder previews) — they display as black (as far as I can tell, in all circumstances). I'm sure it's a tad more complicated than that, but that's the gist.
    Now the bad news — nobody seems to know anything about a fix or workaround (unless you convert your PDFs to process — this might be a fix for sending to clients). It causes issues for me in AI files — being able to view them in the finder (with previews) is a HUGE time saver for my workflow... when they're all black, not so much.
    In my chat with a director of product dev at Adobe, they placed the responsibility to fix on Apple (assuming Apple wants to support Pantone color definitions in their OS).

  • In the file menu why can't i open 'close', 'print', 'properties'?

    in the file menu why can't i open 'close', 'print' and properties'?

    I have a document open. I clic print, then i select 'more options' to print a partiel view (or 'active view') of the document. But i want to have it 100%. When i choose the size of the document, if i select 'adjust' the scale is 73%. If a select 'real size' then i have shades at both end so i don't have the entire page. If i choose 'reduce pages to ...' i get a 73% scale and if i select personnalized scale (100%) there is still shades at both end. So what do i change to get a 100% active view? On the late version i never had that problem. Thank you.

  • I have an iPod touch 4th gen. why does it show the wrong album art only on my ipod and not on itunes? Is there any way I can fix it?

    I have an ipod touch 4th gen. why does it show the wrong album artwork on my ipod and it's fine on itunes. why is that and is there any way to fix it? please help!

    I think it can't find the right or any artwork and ends up putting junk in there.
    And can happen with artist and other tags.
    probably fine with commercial media but otherwise....? I think you have to manaully go in and edit
    I also don't like how it handles and stores non-Apple iTunes store content.

  • Why wont it show me my order status on the iPhone 6, 16GB, Gold?

    Why wont it show me my order status on the iPhone 6, 16GB, Gold?
    I ordered it on 9/27/14, and I got the email that said to check the order status, but when I go to the page it said nothing.

    I was in a similar situation.  The phone I ordered was in stock, with supposedly no shipping delay. I ordered on 9/27, but it actually took four extra business days for Verizon to ship my order.
    I called twice and both times the reps couldn't help be determine the status.
    My assumption is Verizon fulfillment is swamped with orders.  They SHOULD have a way of determining real status but they don't.
    I would suggest waiting a few more days, then call the Internet Order group at 800-922-0204 and start complaining.

  • On my CC drop down menu why is it only Lightroom app that does not have CC

    I have historically used Lightroom as a single purchased product and recently I purchased Creative Cloud.
    As a new user I am very unfamiliar with things but I noticed On my Creative Cloud drop down menu containing a list of all my apps I noticed that each of my apps conclude with CC at the end.
    with other words
    Photoshop CC
    Bridge CC
    Edge Inspect CC
    Scout CC
    Lightroom NOTHING ?
    On my CC drop down menu why is it only Lightroom app that does not have CC at the end of Lightroom.
    Has the system recognised my old Lightroom and it has not installed a CC version or is this the same for everybody out there and if so why?
    Why no CC on the drop down menu after the word Lightroom?

    Why no CC on the drop down menu after the word Lightroom?
    Nothing to worry about. It's the same for everyone and it's normal.
    Lightroom does not follow the Cloud version numbering (yet). It's always had its own version numbering.
    When the Cloud was first released there was no Lightroom included.
    Adobe added Lightroom to the Cloud later but never added CC to the numbering. So yet another layer of confusion was added to the versioning of Cloud software.
    There are now two distinct versions of Lightroom:
    Lightroom 5.6 (perpetual license, does not include Lightroom Mobile)
    Lightroom 5.6 (Cloud which includes Lightroom Mobile)

  • Rejected order why it is showing in V.23 transaction code.

    Hi Expert,
    T.code: V.23  is used to remove the billing block in the sales order.  User is rejected the order but it is still showing in the V.23.
    User question: If the order is rejected why it is showing in V.23 T.code. Is there any T.code where rejected sales order is not showing.
    Can you some one who can help me. Its really good for me.
    Reguards
    Shashi singh
    9371131940.

    Hi Shiva.
    actually  i have this problem with v.23 the sale order is fully reject but still appear in v.23
    V.23
    Regards,

  • My time machine doesnt show up in the finder and ive done the checkboxes in the finder preferences and ive restarted in safeboot. i still cant figure out why it wont show up

    my time machine doesnt show up in the finder and ive done the checkboxes in the finder preferences and ive restarted in safeboot. i still cant figure out why it wont show up

    iOS: Device not recognized in iTunes for Windows

  • Recently when I install apps, the icon does not appear on the menu screen, also, it shows that it is down loading at the app store and when complete, I can not open it or reinstall it.  Help Please   o,

    Recently when I install apps, the icon does not appear on the menu screen, also, it shows that it is downloading at the app store and when complete, I can not open it or reinstall it. Has happened on the last 4 free apps. Help Please

    Reset your iPad. Press and hold both the power and home buttons for 10-15 seconds till the Apple logo appears. Release both buttons. Wait 15-20 seconds till you iPad starts on it's own. Now try and download an app.

Maybe you are looking for

  • Error while transporting update rule.

    Hi experts I am trying to transport one update rule to production.. But it is ending with error code 8 n it is giving me following error :       Errors when activating update rule XXX       IC=0PP_DS03 IS=0CO_OM_OPA_6 error when checking update rules

  • Can't connect to wireless network with Dell Inspiron 1525 with Vista

    I set up a wireless network about a week ago, and have made it with the following security features: WEP, enable only certain MAC addresses to connect, and disabled broadcasting the SSID.  I have been able to use it just fine with my Mac computer usi

  • Need help with Safari auto fill.

    Auto fill problems. 1. It's spotty in its application. On some pages it works fine and fills in all fields with one click. On others it says "can't complete form", but then as I begin typing each field, it gives me fill in options. Why can't it just

  • Select (join) into internal table with nested structures

    Hello Experts, i wonder about the correct notation of a select statement. I have an internal table it_zoll including  two structures as defined below. The select is a join on the two tables zollp and zolls. As coded below the select is syntactically

  • Help me with restore the macbook pro

    how to restore my os x lion when i'v install os x mountain lion pls help me