Is it a bug in IMAQ or what??

Hi All
I am using LabView 6.1 along with IMAQ 2.5.1 for a system that I use to capture images while the camera is moving in X, Y directions. The program was set so that different scans can be made to measure specific sizes of aggregates in each scan. the program will save the two images. an original images as captured by the camera and a processed one which is exposed to different filyering process. Of these filters that were used is to keep particles within specific size and remove any other particles or objects from the original images. What happens is that this filtering work fine most of the time but when analyzing small particles it becomes showing un real objects in the saved image. these objects are not real particles. These object
s would show in places in the processed image where there are nothing in the original image (blank space). Also if the filtering was functioning properly it would remove these small objects because these objects are smaller than the size range needed. So What could be the problem. Is it a bug in IMAq that the filtering is not functioning properly? or what could it be? See attached VI. you can undestand what I am saying. could there be a solution for this
Attachments:
Snap_Image#100.vi ‏230 KB

hi,
You can try to create two or more image buffer to two different images,one for original image and one for processed image.From your VI ,you only use one image buffer.It maybe make error .

Similar Messages

  • IMAQ AVI - What is "frame read lookahead"?

    Hi,
    I'm using The IMAQ AVI Read Frame function, and just wondering what the "frame read lookahead" input actually does. The documentation is very vague.
    Thanks

    What is vague about it? What additional information do you need?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Bug in IMAQ (CWIMAQPoints.Remove)

    There is a bug in the CWIMAQPoints.Remove funtion that affects the previous point. I have included a sample program.
    Attachments:
    Bug.zip ‏3 KB

    This has been fixed in the latest version of the software. You can download the patch from:
    ftp://ftp.ni.com/support/imaq/pc/vision/update605/
    The README explains how to install the cwimaq.ocx patch.
    Hope this helps,
    Brad Buchanan
    National Instruments

  • Generating a List of References in FM12 to include External Cross-References and Imported Graphics, but no Imported Graphic references show in the LOR.  Is this a bug in FM12 or what am I doing wrong?

    and has always generated the list of references just fine.  Now in FM12, the LOR no longer will give any references for the Imported Graphics.  I have even tried creating a new chapter from the FM12 templates, adding the chapter to the front of the book, and allowing FM12 to use that file as the template for the LOR.  Still no success - it will not give any references to the Imported Graphics in my chapter files.  Is this a bug in FM12?  Is there something different about FM12 that would cause this not to work with existing FM11 files???  Please help, I need this resolved and working.
    Thank you,
    Beverly

    Arnis and Jeff,
    Thank you both very much for your assistance.  I was able to figure out why the Adobe Application Manager kept failing on installing the patches.  Idiot me didn't unzip them first.  Once I unzipped the patch files, the installer worked fine.  Both patches are now successfully installed; my FM version is now 12.0.2..
    To answer some of your questions:
    Yes, I have administrator privileges on my PC.
    Yes, I had all of the files in the book opened when I generated and/or updated the LOR file.  So that was not the issue.
    With the patches installed, I opened a book and all of its files.  I updated the LOR and all works fine – it gives me all of the Imported Graphic references. So there must have been an issue with that release of FM12 (12.0.0.329), which was fixed with the patches.
    Again, thank you both for your help!
    Best regards,
    Beverly

  • What this ?!!! bug in software or what ?

    When i open calls and press hold on any contact this is i see .
    what this ?
    Nader A. Samaan

    How did you import or transfer your phone directory or contacts into this Z10?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • JFileChooser crashes JVM - bug basically ignored. What can I do?

    See:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7160713
    The bug has been marked as incomplete,needs more info, and "Low Prioroty" - Yet there is no mechanism to provide any more information. There is no way to add comments, or vote. The bug brings down the entire JVM with a native crash and it is trivial to reproduce.
    I would provide any information that is asked of me - but I need a way to do it. I think I got an email request for info (It's been a while now), but replies to the email bounced, and as noted above the bug page has no way to give feedback.
    Use any JFileChooser, click on the "Details" view. Then start clicking on column headings... after a few clicks the JVM crashes. Tested again with 7u6 - still crashes.

    This reproduces the problem more reliably for me.
    * JFileChooser Windows Crash
    package filechoosercrash;
    import java.awt.AWTEvent;
    import java.awt.BorderLayout;
    import java.awt.Robot;
    import java.awt.Toolkit;
    import java.awt.Window;
    import java.awt.event.AWTEventListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.util.concurrent.CountDownLatch;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.LookAndFeel;
    import javax.swing.SwingUtilities;
    import javax.swing.UIManager;
    import javax.swing.UIManager.LookAndFeelInfo;
    import javax.swing.UnsupportedLookAndFeelException;
    * @author scott
    public class FileChooserCrash {
         static CountDownLatch latch = new CountDownLatch(1);
         static JFrame frame;
         static JButton button;
         static JFileChooser chooser;
         static Robot robot;
         private static AWTEventListener terminator = new AWTEventListener() {
              @Override
              public void eventDispatched(AWTEvent event) {
                   System.exit(10);
          * @param args the command line arguments
         public static void main(final String[] args) throws Exception {
              SwingUtilities.invokeLater(new Runnable() {
                   @Override
                   public void run() {
                        try {
                             swingMain(args);
                        } catch (Exception ex) {
                             Logger.getLogger(FileChooserCrash.class.getName()).log(Level.SEVERE, null, ex);
              latch.await();
              // do the clicks
              sleep(3000);
              Toolkit.getDefaultToolkit().addAWTEventListener(terminator, AWTEvent.KEY_EVENT_MASK);
              long now = System.currentTimeMillis();
              for (int c = 0; c < 10; c++) {
                   Window w = JDialog.getWindows()[1]; // better be there!
                   System.out.println("w=" + w);
                   int detailsX = w.getX() + w.getWidth() - 36;
                   int detailY = w.getY() + 50;
                   int headingY = w.getY() + 100;
                   System.out.println("details at " + detailsX + ", " + detailY);
                   // Click details
                   robot.mouseMove(detailsX, detailY);
                   clickMouse();
                   sleep(100);
                   // Click column headings
                   while (System.currentTimeMillis() - now < 2 * 1000) {
                        int headingX = w.getX() + (w.getWidth()/2) + (int) (Math.random() * (w.getWidth()/2));
                        robot.mouseMove(headingX, headingY);
                        clickMouse();
                        sleep(300);
                   // Cancel
                   robot.mouseMove(w.getX() + w.getWidth() - 36, w.getY() + w.getHeight() - 36);
                   clickMouse();
                   sleep(300);
                   // re-open
                   robot.mouseMove(frame.getX() + 36, frame.getY() + 36);
                   clickMouse();
                   sleep(1000);
                   now = System.currentTimeMillis();
         private static void sleep(int millis) {
              try {
                   Thread.sleep(millis);
              } catch (InterruptedException ex) {
         private static void clickMouse() {
              robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
              sleep(100);
              robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
         private static void swingMain(String[] args) throws Exception {
              //switchToNimbus();
              robot = new Robot();
              frame = new JFrame("JFileChooser Crash Test");
              button = new JButton("Start...");
              button.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        showFileChooser(frame);
              frame.getContentPane().add(button, BorderLayout.CENTER);
              frame.getContentPane().add(new JLabel("Press \"Start...\" and let go of the mouse.  Robot will be used to change FileChooser to details view and then quickly click column headings until the crash."), BorderLayout.SOUTH);
              frame.pack();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         static void showFileChooser(JFrame parent) {
              chooser = new JFileChooser("C:\\");
              latch.countDown();
              chooser.showOpenDialog(parent);
         private static void switchToNimbus() throws UnsupportedLookAndFeelException, IllegalAccessException, InstantiationException, ClassNotFoundException {
              for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
                   if (laf.getName().startsWith("Nimbus")) {
                        System.out.println("Using " + laf.getName());
                        UIManager.setLookAndFeel(laf.getClassName());
                        break;
    }

  • 2.01 Did not fix long backup bug for me.  What do I need to do?

    Hi,
    The update has not corrected the long backup time bug for me. Started a backup 30 mins ago and based on the progress bar it will run for at least another 2.5 hours. I don't understand how it can take that long to backup less than 8GB of information. Do I need to change a setting or delete old iTunes backup files to get this process working correctly. Most of the other bugs I encountered with version 2.0 seem to be resolved but this backup bug is a time waster. Do I need to take the phone and my mac to the Apple store and have them look at it?
    Thanks,
    D

    You can cancel the backup process by hitting the x in the progress window and it will go directly to the sync if it is taking it too long.

  • HELP ! A FATAL BUG ! ! ! What`s wrong with the SATA port ? ? ?

    My MacBook (MD103) got a serious bug here, PLEASE HELP ME !
    I changed my main drive to a Crucial 256GB SSD and memory to Micron 16GB, and I also removed the optical drive. The optical drive has been replaced by the original Toshiba HDD. Then, the question has came out! The OS hourly report Errors and restart. Finally, the HDD icon will disappear from Finder and the drive will be changed into a read-only disk (Under the Windows OS installed by BOOTCAMP). Then, I have to format the drive.
    BUT the question still happen AGAIN AND AGAIN! Though, I changed the Toshiba Drive by a WesternDigital one (Model. LPVT 500G), which is the most energy-efficient notebook HDD, BUT the question take place AGAIN when I listening an iTunes music ! ! !  (The music tone was reapted again and adain, and the OSX was shut down in a sudden, without any operation)
    I searched some information and did some attempt. The OS can work well when I change the second drive by a old 250GB HDD, but I really can`t use such a slow and small drive for work, and I have to pray for my data every time when I press the power button. So, please help me! Improve the SATA port power management or someting else, THE BUG CAN BE SOLVED BY YOU, THE GREATEST ENGINEERS.
    Please let me know the progress, THANK YOU ! ! !

    Firstly, Thanks!
    I've checked it and if the question didn`t occur, the disk can work well. The I/O speed can reach 113MB/s. And someone said it causes by SATA port power supply.

  • Directory creation Bug or Error or what?

    Hey - okay, I'm still using version .9, not .10 of Tiger. A few times a couple of layers deep in a directory, I've created a new directory/folder - name it "one". I've then copied RAW camera files into that directory. I'll then back out, make sure the data is there - it is. Then I go back to add a "two" directory. I'll back out to go find the next RAW camera card, copy it, move through "finder" back to where "two" should be, along with "one" and there are two "two" directories and the files can't be found.
    Why would such a thing happen? And have I been clear with the problem?
    Thanks -
    Glen

    Yes, I think I know what you are doing, and have seen several instances that sound like the same bad behavior, see this recent discussion:
    http://discussions.apple.com/thread.jspa?threadID=1066455&tstart=50
    Like rccharles in that thread I too would like to know what shows up in Terminal. I would also like to know what happens if you relaunch the Finder (you can do that by holding down the Option key, then click on the Finder icon in the Dock and select Relaunch from the menulet). The OS X Finder has been rather infamous through several different iterations for having bizarre updating problems, perhaps this is a new version of an old problem.
    Francine
    Francine
    Schwieder

  • Hey friends, iphone keeps powering off diagnostics says bug 115 anyone know what it is

    Bug_type 115

    Thanks for the suggestions!
    Except I tried all those before I even made this topic lol, but thanks!
    I Already popped out the Sim Card & let my phone sit without it for a few minutes then put it back in. Sometimes it will work again & it will say it recognizes the SIM Card but more times then not it still says it cant recognize it! So I have to take it out & reinsert it multiple times.
    & I have done a complete restore 2 times & a back up restore 3 times. Nothing seems to be working.
    I am planning on going to the Apple Store this week, wish me luck!
    But keep the suggestions coming if you have any, I'd appreciate it!

  • Why can I participate in surveys and post questions, but whee FaceTime or use messaging, I can't. I'm told I have no internet connection...but I do have it...do I have a bug is this a what I call a windows nightmare?

    Why can I participate in surveys and post questions, but can' t use FaceTime or messaging  without being told I have no internet connection? However,  my iPad shows full internet connectivity.

    Apple has released a document which is reported to address the recent FaceTime issue.
    http://support.apple.com/kb/TS5419

  • IMAQ vision bug in several IMAQ vision functions

    Some IMAQ Vision functions malfunction if you use the source image as the mask. I keep running into this bug in IMAQ Vision, some Vision functions exhibit this behavior, and some don't. It is not documented in the function descriptions. Even if it were, it would still be a bug. Example:
    1. Create a U8 source image that contains some zeros and some nonzero values.
    2. Wire the image into the source input and mask input of IMAQ Quantify and return the % value of the global report to see what percentage of pixels are nonzero.
    The answer is wrong. If you copy the image into a separate image first, and wire the separate image into the mask input, you get the correct answer. See attached VI for edification
    Cheers,
    -root
    Message Edited by Root Canal on 04-20-2009 06:06 PM
    Message Edited by Root Canal on 04-20-2009 06:08 PM
    global variables make robots angry
    Attachments:
    mayor of bug town.vi ‏43 KB
    mayor of bug town.PNG ‏18 KB

    Identical thread in Machine Vision discussion forum: mask bug in several IMAQ vision functions
    Hope this helps.
    -Ben
    WaterlooLabs

  • Multiple IMAQ version on single computer

    I have a number of cameras that I work with - mostly CameraLink, but one LVDS. I'd like to be able to develop and test these from one machine, but there is a bug in more recent versions of IMAQ that cause the camera data to be delayed and/or shifted (I found this out through e-mail correspondance with one of NI's support people). For the CameraLink, I'd like to use the most recent version of IMAQ. What would be the best way to have both version accessible on one computer? Can I install them to different user accounts, so they are only accessible to a single user? Would the only way to do this be to dual-boot?
    Thanks,
    Gard
    Solved!
    Go to Solution.

    Try to install them on different user accounts in single boot system.
    Sasi.
    Certified LabVIEW Associate Developer
    If you can DREAM it, You can DO it - Walt Disney

  • What is mapLN and why is it eating all our space :)

    here's a DbPringLog from a few months ago:
    <pre>
    [xoopit@xda-004 ###]$ java -jar ~/###/je-3.3.74.jar DbPrintLog -s 0x00000000 -e 0x0000000a -S
    <DbPrintLog>
    Log statistics:
    type total provisional total min max avg entries
    count count bytes bytes bytes bytes as % of log
    LN_TX 219,704 0 26,803,878 117 132 121 44.7
    MapLN 14 0 956 59 72 68 0
    NameLN_TX 4 0 292 69 79 73 0
    DupCountLN_TX 73,025 0 5,915,025 81 81 81 9.9
    DupCountLN 211 211 11,816 56 56 56 0
    FileSummaryLN 10 0 69,506 91 26,681 6,950 0.1
    IN 2,033 76 8,213,996 67 6,368 4,040 13.7
    BIN 4,064 3,957 12,297,614 57 6,319 3,025 20.5
    DIN 799 54 253,737 197 687 317 0.4
    DBIN 1,334 1,333 3,626,993 166 6,389 2,718 6
    Root 4 0 326 62 88 81 0
    Commit 73,238 0 2,783,044 38 38 38 4.6
    CkptStart 2 0 81 39 42 40 0
    CkptEnd 3 0 256 84 87 85 0
    BINDelta 35 0 19,110 75 975 546 0
    FileHeader 7 0 266 38 38 38 0
    key/data 13,621,638 (22.7)
    Total bytes in portion of log read: 59,996,896
    Total number of entries: 374,487
    Per checkpoint interval info:
    lnTxn ln mapLNTxn mapLN end-end end-start start-end maxLNReplay ckptEnd
    0 0 0 1 1,345 563 782 0 0x0/0x541
    20,529 0 0 7 5,516,716 4,949,678 567,038 20,529 0x0/0x5432ed
    128,339 0 0 6 34,716,133 54,481,939 0 128,339 0x7/0x392d2
    70,836 0 0 0 19,765,806 19,765,806 0 70,836 0xa/0x0
    </DbPrintLog>
    </pre>
    then a few days ago:
    <pre>
    [xoopit@xda-004 ###]$ java -jar ~/###/je-3.3.74.jar DbPrintLog -s 0x003ca27f -e 0x003cb06b -S
    <DbPrintLog>
    Log statistics:
    type total provisional total min max avg entries
    count count bytes bytes bytes bytes as % of log
    LN_TX 534 0 51,086 86 108 95 0.1
    LN 267,341 0 22,505,538 77 93 84 25.3
    MapLN 9 0 668,956 74,226 74,539 74,328 0.8
    DupCountLN_TX 178 0 11,393 63 65 64 0
    DupCountLN 22 0 912 40 42 41 0
    FileSummaryLN 7,669 0 693,427 72 2,462 90 0.8
    IN 9,182 166 33,886,067 81 6,428 3,690 38.1
    BIN 7,731 491 24,977,397 49 6,478 3,230 28.1
    DIN 909 9 2,468,396 144 6,445 2,715 2.8
    DBIN 619 56 3,555,037 136 6,494 5,743 4
    Root 1 0 8,260 8,260 8,260 8,260 0
    Commit 178 0 6,230 35 35 35 0
    CkptStart 7 0 224 32 32 32 0
    BINDelta 153 0 21,740 42 1,284 142 0
    DupBINDelta 14 0 4,686 74 1,324 334 0
    Trace 114 0 20,812 76 306 182 0
    FileHeader 10 0 380 38 38 38 0
    key/data 13,167,649 (14.8)
    Total bytes in portion of log read: 88,880,541
    Total number of entries: 294,671
    Per checkpoint interval info:
    lnTxn ln mapLNTxn mapLN end-end end-start start-end maxLNReplay ckptEnd
    534 267,341 0 9 30,270,000,000 30,258,643,275 0 267,875 0x3cb06b/0x0
    </DbPrintLog>
    </pre>
    and from today:
    <pre>
    xoopit@xda-004 ###]$ java -jar ~/###/je-3.3.74.jar DbPrintLog -s 0x004207c0 -e 0x004207c9 -S
    <DbPrintLog>
    Log statistics:
    type total provisional total min max avg entries
    count count bytes bytes bytes bytes as % of log
    LN 44 0 3,507 78 93 79 0
    MapLN 32 0 76,040,837 295,485 8,572,698 2,376,276 96.7
    FileSummaryLN 156 0 9,362 30 220 60 0
    IN 36 2 110,580 46 6,178 3,071 0.1
    BIN 43 43 88,914 79 6,478 2,067 0.1
    Root 11 0 2,405,444 218,657 218,708 218,676 3.1
    CkptStart 1 0 31 31 31 31 0
    CkptEnd 1 0 71 71 71 71 0
    Trace 13 0 1,146 51 282 88 0
    FileHeader 10 0 380 38 38 38 0
    key/data 1,967 (0)
    Total bytes in portion of log read: 78,660,272
    Total number of entries: 347
    Per checkpoint interval info:
    lnTxn ln mapLNTxn mapLN end-end end-start start-end maxLNReplay ckptEnd
    0 44 0 22150,110,853,335150,109,212,264 1,641,071 44 0x4207c6/0xd0557
    0 0 0 10 29,146,665 29,146,665 0 5 0x4207c9/0x0
    </DbPrintLog>
    </pre>
    as you can see 96.7% of our store is taken up by these mapLN entries. we haven't found any documentation as to what these things are. this is killing one of our BDB stores because in the last 24 hours we've generated around 10,000 new .jdb files when we used to have a few hundred...
    we're using je-3.3.74
    we upgraded to je-3.3.74 (from 3.3.62) on November 3rd but this particular issue didn't show up until around 24 hours ago.
    thanks for taking a look ~j
    Edited by: jules | xoopit on Nov 13, 2008 11:59 AM
    Edited by: jules | xoopit on Nov 13, 2008 1:11 PM

    Hi All,
    We've been working on this with the Xoopit folks and I wanted to follow up and post the resolution, since it potentially impacts everyone using JE 3.3.x.
    There is a bug in JE 3.3.74 and earlier, in all versions of the 3.3.x product. The fix for this is in JE 3.3.75, which currently is available on request. We haven't decided when we'll update our download site with this updated release. If you would like the updated release, please send email to mark.hayes at the obvious .com (oracle).
    Here's the change log entry for the bug, which should explain what you need to know:
    Fix a bug that caused the space taken by internal metadata in JE log files to increase over a long period of time. The rate of increase was slow in most cases, but in at least one observed case became rapid after a long time period and after the log cleaner became backlogged. To determine whether your JE log exhibits this problem, run
    java -jar je.x.y.z.jar DbPrintLog -h DIR -S
    and examine the line labeled MapLN on the left. If the amount of the log taken by MapLNs is 10% or greater, or if you see this number increasing steadily over time, then your application is probably experiencing this problem.
    By installing JE 3.3.75 or later, the excess disk space will automatically be reclaimed over time, as ordinary checkpoints and log cleaning occur. If you wish to recreate your database rather than wait for this to occur gradually, you can use DbDump and DbLoad to do so.
    We'd like to express our appreciation and sincere thanks to Jules and the other folks at Xoopit who reported this problem and helped us to diagnose it. We would not have found or fixed this problem as quickly as we did without their help.
    For reference, the support ticket # for this problem is: #16610
    If you have further questions, please reply to this forum post.
    Thanks,
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem with JMenus that Persist - Is this a Java bug?

    I am having a problem with JMenus that persist. By this I mean
    that my drop down menus persist on the screen even after they have
    been selected.
    I've checked the Java bug database, and the following seems
    to come closest to my problem:
    Bug ID: 4235188
    JPopupMenus and JMenus persist when their JFrame becomes visible
    State: Closed, not a bug
    http://developer.java.sun.com/developer/bugParade/bugs/4235188.html
    This page says that the matter is closed and is not a bug. The
    resolution of this matter printed at the bottom of the page
    is completely abstruse to me and I would appreciate any
    comments to understand what they are talking about.
    The code at the end of my message illustrates my problem.
    1. Why should paintComponent() make any difference to
    Menu behavior?
    2. Is this a bug?
    3. What's the workaround if I have to paint() or repaint()?
    Thanks
    Tony Lin
    // Example of Menu Persistence Problem
    // Try running this with line 41, paintComponent(), and without line 41
    // Menus behave normally if line 41 is commented out
    // If line 41 exists, menus will persist after they have been selected
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class P2 extends JPanel {
    JMenuItem[] mi;
    public P2() {
    JFrame thisFrame = new JFrame();
    thisFrame.getContentPane().add(this);
    JMenu menu = new JMenu("My Menu");
    JMenuBar mb = new JMenuBar();
    mi = new JMenuItem[4];
    for (int i=0; i<mi.length; i++) {
    mi[i] = new JMenuItem("Menu Item " + String.valueOf(i));
    menu.add(mi);
    mb.add(menu);
    thisFrame.setJMenuBar(mb);
    thisFrame.setSize(400,200);
    thisFrame.setLocation(150,200);
    thisFrame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    thisFrame.setVisible(true);
    public void paintComponent(Graphics g) {} //Affects menu behavior!
    public static void main(String[] args) {
    new P2();

    Well, my understanding of the way painting works is that a component doesn't UNPAINT itself. Instead a message is sent to the component under the coordinates of the menu to REPAINT itself.
    In your demo program the JFrame is the component under the JMenu. The paintComponent() method of JFrame is empty, so nothing gets repainted.
    I added super.paintComponent(g); to the method and everything works fine.

Maybe you are looking for