JMenu with AWT component

dear friends;
i have added menu bar in Jframe which is containes menues.
AWT component is added the the same frame .
problem is:
menues are overlapping with awt component while i clicked the menu bar.
dear friends help me immediately.
thank u

dear friends help me immediately.It's your own fault or combining Swing and AWT widgets. You're not supposed to do that, as it can lead to strange effects. Like this one.

Similar Messages

  • JSplitPane with AWT component

    Hi all,
    I have a problem with JSplitPane, I use it with JPanel as right component and an AWT component as left Component, so when I move The Divider of the JSplitPane it hides under the AWT component not on the top of it.
    I know that result from problem of heavy weight component and light weight component .. but my question is there any work arround I can do to make the Divider appear on the top of the AWT component??
    Thanks,

    You've been given an idea: DO NOT MIX AWT and SWING Components.
    Why do you need to mix them? What is the AWT component?
    If it's something you wrote yourself, then you can change it. If it's not, decompile it and change it. Anyone who can't provide a Swing version of their stuff at this point is out of business and shouldn't care what you do with it.
    If it's some Canvas subclass, you can make it a Swing component by changing 2 lines: extends JPanel instead of Canvas and change paint() to paintComponent().
    is there any work arround I can do to make the Divider appear on the
    top of the AWT component??definitely not, unless you make the divider a heavyweight component somehow.

  • C++ form with awt controls do not respond

    I have created mfc project in visual studio c++ 6.0. Then I modified MainFrm.cpp.
    Here in CMainFrame::OnShowWindow I initialize jvm, create WEmbeddedFrame and put Button in it. Is runs ok, but 2 problems:
    1. I can't click button. Just as there is some panel over java gui and it catches all mouse and keyboard events.
    2. java gui some times do not repaints itself, or repaints only part of it
    The form was inspired by http://www.codeproject.com/KB/cpp/OOJNIUse.aspx (but I do not use OOJNI, as you can see).
    There is a bug in WEmbeddedFrame, but it deals with swing, not awt: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4982522. To work around it I call addNotify() method.
    Can someone help me with this code?
    // MainFrm.cpp : implementation of the CMainFrame class
    #include "stdafx.h"
    #include "mfc.h"
    #include <jni.h>
    #include <string.h>
    #include <jawt.h>
    #include <jawt_md.h>
    #include <comdef.h>
    #include "MainFrm.h"
    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif
    // CMainFrame
    IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
    BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
         ON_WM_CREATE()
         ON_WM_SHOWWINDOW()
    END_MESSAGE_MAP()
    static UINT indicators[] =
         ID_SEPARATOR,           // status line indicator
         ID_INDICATOR_CAPS,
         ID_INDICATOR_NUM,
         ID_INDICATOR_SCRL,
    jobject obj_frame;
    JNIEnv *env;
    jclass class_JString;
    // CMainFrame construction/destruction
    CMainFrame::CMainFrame()
         // TODO: add member initialization code here
    CMainFrame::~CMainFrame()
         //jvm->DestroyJavaVM();
          TRACE0("JVM destroyed\n");
    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
         if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
              return -1;
         if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
              | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
              !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
              TRACE0("Failed to create toolbar\n");
              return -1;      // fail to create
         if (!m_wndStatusBar.Create(this) ||
              !m_wndStatusBar.SetIndicators(indicators,
                sizeof(indicators)/sizeof(UINT)))
              TRACE0("Failed to create status bar\n");
              return -1;      // fail to create
         // TODO: Delete these three lines if you don't want the toolbar to be dockable
         m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
         EnableDocking(CBRS_ALIGN_ANY);
         DockControlBar(&m_wndToolBar);
         return 0;
    void CMainFrame::OnShowWindow(BOOL bShow, UINT nStatus) {
         CFrameWnd::OnShowWindow(bShow, nStatus);
         //******************************** JAVA
         JavaVM * jvm;
         long status;
          JavaVMOption options[2];
         JavaVMInitArgs vm_args;
          options[0].optionString = ".Djava.class.path=.;c:\\";
          options[1].optionString = "-verbose:jni";
         memset(&vm_args, 0, sizeof(vm_args));
         vm_args.ignoreUnrecognized = true;
          vm_args.version = JNI_VERSION_1_4;
         vm_args.nOptions = 2;
         vm_args.options = options;
          status = JNI_CreateJavaVM(&jvm, (void**) &env, &vm_args);
         if (status == JNI_ERR) {    
              return;
          TRACE0("JVM created\n");
          //class_JString = env->FindClass("foo/Test");
          TRACE0("Class found\n");
          //create frame
          //jmethodID id_Test = env->GetMethodID(class_JString, "<init>", "(J)V");
          TRACE0("Method found\n");
          //obj_frame = env->NewObject(class_JString, id_Test, m_hWnd);
          TRACE0("Object created\n");
         jclass class_Button = env->FindClass("java/awt/Button");
          TRACE0("Class Button found\n");
         jclass class_WEmbeddedFrame = env->FindClass("sun/awt/windows/WEmbeddedFrame");
          TRACE0("Class WEmbeddedFrame found\n");
         jclass class_Container = env->FindClass("java/awt/Container");
          TRACE0("Class Container found\n");
          jmethodID b_const = env->GetMethodID(class_Button, "<init>", "(Ljava/lang/String;)V");
          TRACE0("Constructor Button found\n");
          jmethodID f_const = env->GetMethodID(class_WEmbeddedFrame, "<init>", "(J)V");
          TRACE0("Constructor WEmbeddedFrame found\n");
          jmethodID f_add = env->GetMethodID(class_Container, "add", "(Ljava/awt/Component;)Ljava/awt/Component;");
          TRACE0("Method WEmbeddedFrame.add found\n");
          jmethodID f_setSize = env->GetMethodID(class_WEmbeddedFrame, "setSize", "(II)V");
          TRACE0("Method WEmbeddedFrame.setSize found\n");
          jmethodID f_show = env->GetMethodID(class_WEmbeddedFrame, "show", "()V");
          TRACE0("Method WEmbeddedFrame.show found\n");
          jmethodID f_addNotify = env->GetMethodID(class_WEmbeddedFrame, "addNotify", "()V");
          TRACE0("Method WEmbeddedFrame.addNotify found\n");
          jobject button = env->NewObject(class_Button, b_const, env->NewStringUTF("qqq"));
          TRACE0("Button created\n");
          jobject frame = env->NewObject(class_WEmbeddedFrame, f_const, m_hWnd);
          TRACE0("WEmbeddedFrame created\n");
          env->CallVoidMethod(frame, f_addNotify);
          TRACE0("Frame added Notify\n");
          env->CallVoidMethod(frame, f_setSize, 100, 100);     
          TRACE0("WEmbeddedFrame setSize called\n");
          env->CallVoidMethod(frame, f_add, button);
          TRACE0("Button added\n");
          env->CallVoidMethod(frame, f_show);
          TRACE0("Frame shown\n");
          //******************************** JAVA
          ShowWindow(SW_NORMAL);
    BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
         if( !CFrameWnd::PreCreateWindow(cs) )
              return FALSE;
         // TODO: Modify the Window class or styles here by modifying
         //  the CREATESTRUCT cs
         return TRUE;
    // CMainFrame diagnostics
    #ifdef _DEBUG
    void CMainFrame::AssertValid() const
         CFrameWnd::AssertValid();
    void CMainFrame::Dump(CDumpContext& dc) const
         CFrameWnd::Dump(dc);
    #endif //_DEBUG
    // CMainFrame message handlers

    Don't post new questions on old threads.
    ...in C calling a Java Applet. And your program do it.How do you figure?
    I seriously doubt that the fundamental problem here is a JNI problem versus just a java one. I would expect that the applet viewer either calls a Sun class or even a Java API class. Nothing more. Asking a carefully phrased question in one of the GUI forums might get the answer as well as getting the Sun source for any recent jdk and looking at the code for the applet viewer.

  • JAVA 7u4 with Flex component.

    While Removing Tabbed Pane having Flex Component , on java 7u4 throws following exception.
    Note : it works fine with JAVA 6u32
    .... FlexServiceThread exited...
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at sun.java2d.ScreenUpdateManager.createScreenSurface(Unknown Source)
    at sun.java2d.d3d.D3DScreenUpdateManager.createScreenSurface(Unknown Source)
    at sun.awt.windows.WComponentPeer.createScreenSurface(Unknown Source)
    at sun.awt.windows.WComponentPeer.replaceSurfaceData(Unknown Source)
    at sun.awt.windows.WComponentPeer.replaceSurfaceData(Unknown Source)
    at sun.awt.windows.WComponentPeer.updateGraphicsData(Unknown Source)
    at java.awt.Component.updateGraphicsData(Unknown Source)
    at java.awt.Container.updateGraphicsData(Unknown Source)
    at java.awt.Container.updateGraphicsData(Unknown Source)
    at java.awt.Component.setGraphicsConfiguration(Unknown Source)
    at java.awt.Container.remove(Unknown Source)
    at javax.swing.JTabbedPane.removeTabAt(Unknown Source)
    at testing.test.myTabbedPane.*removeTabAt*(myTabbedPane.java:42)
    Please Help ?

    That's really weird!
    After digging around, reinstalling Flash CS3 again and doing
    multiple tests, I finally found the source of the problem:
    Two .swc files residing in the same folder where I was saving
    my tests files were avoiding the Flash compiler to successfully
    create new .swc files!? I cannot understand how this can be
    possible. As soon as I choosed a new folder for saving the test
    files, I could link to the .swc and access the component from Flex.
    Also as soon as I moved out the two culprid files I could again
    save in the previous folder...
    Does anyone has an idea how this can happen?
    For those interested in the case, you can download the 2
    culprid files
    here
    Best regards,

  • HTML with AWT

    Hi every body !
    Can someone please tell me how I can manage HTML with a AWT component ?
    With Swing, we for example use JEditorPane or JTextPane as I did for a JApplet (http://www.big-chat.com).
    As it is for Applet, I want it to be avalaible in all browsers. But now, it is not the case !
    Please help.
    Thanks !

    Why won't JApplet work in all browsers? Every browser that I know (that is graphical) supports the Java plug-in.
    If you want to support the MS JVM in IE users without the plugin, well there are some things you should know:
    1) MS is not shipping this anymore for newer systems (Win 2003 and XP SP1a).
    2) It's Java version 1.1.4, so there's a whole heck of a lot of stuff that won't work.
    3) It's going to be officially retired in 2007 (was supposed to be in Sept 2004, actually).
    I highly doubt that there's an AWT-based HTML display component out there. There's not one written in Swing that is a complete, up-to-date browser as it is.
    Just stick with the plugin.

  • An Awt Component Identifying Its display Status

    I am writing a custom Component (one extending java.awt.Component) for a game which would be running under Applet. Is it possible for a Component to identify if the Applet window (the browser) is put into the background, minimised or hidden? The Component.isShowing() call seems to return true regardless of the status of the browser window. I don't want to rely on Applet.start()/Applet.stop() and want each Component to be able to do this. Is it possible?
    Edited by: alec_lee_yl on Jan 28, 2010 5:39 PM

    If you use a fixed-width font then you will be able to pad the strings with the right number of blanks and get your columns to line up.

  • Synchronization on awt component

    I was facing some deadlock issues on the awt component and trying to resolve the problems. I have searched using google and also in this forum but not much information that i can found. Anyone have some good article on sychonization on awt component ?
    By the way, I have some question on the synchronization issues on awt component. Questions as below :
    1. we should only synchronize out component by synchronized on getTreeLock() ? From what i know is that anything to do which layout and changing the structure of tree of awt component should synchronize the tree lock. Am i correct on this ?
    2. since paint() method only being execute by AWT-Thread (correct ?), the paint() method shouldn't be synchonized ? If I was refering to a lot of informations in my paint method when doing painting, how i can make sure those informations/data was synchronized ?
    3. It was recommended that any layout process of component should be done by AWT-Thread (Event Dispatching Thread) ? Currently my product have to compatible with jre 1.1. which invokeLater() only introduced in java 1.2. How can I layout my component in AWT-Thread ?

    Hi!
    Sorry to read that. Unfortunately, Firefox Sync is not a back up service and the information is stored in the servers only temporarily so the rest of your devices can get the information.

  • How can I do live streaming with a Mac Book Pro 2011, using a new model of Sony HD camcorder which does not have firewire out/input? it comes only with a component video output, USB, HDMI and composite RCA output?

    I need to do live streaming with a Mac Book Pro 2011, using a new model of Sony HD camcorder (http://store.sony.co...ber=HDRAX2000/H) ..this camcorder model does not have firewire out/input ..it comes only with a component video output, USB, HDMI and composite A/V video output..
    I wonder how can I plug this camcorder to the firewire port of my laptop? Browsing on internet I found that Grass Valley Company produces this converter http://www.amazon.co...=A17MC6HOH9AVE6 ..but I am not sure -not even after checking the amazon reviews- if this device will send the video signal through firewire to my laptop, in order to live streaming properly? ..anyone in this forum could help me please?
    Thanx

    I can't broadcast with the built in iSight webcam... how would I zoom in or zoom out? or how would I pan? I've seem people doing it walking with their laptops but that's not an option for me... there's nothing wrong with my USB ports but that's neither an option to stream video because as far as I know through USB you can't connect video in apple operating systems ..you can for sure plug any video cam or photo camera through usb but as a drive to transfer data not as a live video camera...  is by firewire an old interface developed by apple that you can connect all sorts of cameras to apple computers... unfortunately my new sony HDR-AX2000 camcorder doesn't have firewire output...
    thanx

  • How to connect Apple TV (2g) HDMI to HDTV with only component video input.

    Trying to connect Apple TV (2g) HDMI to HDTV with only component video input.  Can I use a simple cable or do I need a converter box/plug? Is the HDMI signal coming from ATV encrypted or HDCP enabled?
    The TV is HD, but only has a component input and not HDMI.  Apple TV 2g only has HDMI output.

    google component hdmi converter
    but they are pretty expensive and may not work at all
    and will not work with any DRM material as in movies you reant and maybe netflix and the sports thingy

  • Sub-contracting with chargeable component.

    Hi All,
    I am doing following scenario
    Scenario: Sub-contracting with chargeable component.
    Activity: Clearing (Consumption-Based)
    T Code - /n/SAPNEA/JSCR19
    Amount: 23,100,000
    While action posting, we are getting following error message
    Error Message: E The difference is too large for processing
    Kindly suggest where to do necessary changes in the system.
    Rahul

    Hi,
    This procedure provides the way of manual payment for Subcontract expense.
    I want to clear Accrued revenue by deduction AP using T code /n/SAPNEA/JSCR19
    While posting, I am getting error message “Amount too large to clear", maybe the system set the limit for the tolerance value for clear document. Please suggest me, where to change the settings.
    Rahul

  • Error when creating a Report with Form component

    I am trying to create a new report with form component but when I try to choose the Table/View name I get a web error "404 web not found". I know for a fact that the list is working because I see the list when I create a "simple form". Is this a bug or i need to do something to get it working? thanks

    419008,
    It is a bug that has been identified and will be corrected in an HTML DB patch. There is nothing you can do to correct it.
    This bug is specific to Internet Explorer and utf-8 encoding. It is not a bug with IE, it is a bug with how we handle this for IE.
    Joel

  • Relation with parent components view with child component

    Hi All,
    Can a view controller of  one component can use his child component with the component usage declaration?
    Regards
    Chandra
    Edited by: Chandra Sekhara on Jan 4, 2008 4:26 AM

    Ok got it.
    Nothing much you have to do.
    (1)Go to C1's used component and add C2 as used component.
    (2)It will give you two options manual or CreateOnDemand, if you do not need any kind of values to initiate the C2's view then choose 2nd one.
    If you need some iteration before initiating the view then use manual option.
    you need to write this statement to create the compoment:-
    wdThis.wdGet<used component name>ComponentUsage().createComponent();
    (3) Now go to the window of C1 and embed interfaceview, when you click on this you will get C2's interface view.
    (4) If you want some methods or events to be declared then declare in C2's component controller and copy it to the interface controller.
    Now run your application

  • How to get the contents associated with a component.

    How to get the contents associated with a component.
    Like i have 2 buttons and i want to get the contents associated with these button without clicking them i.e without firing the event.
    By Contents i mean, whatever things we get after firing the event,we get some other window and some thing is added to the current page and so on.

    grab all the code inside the actionPerformed(ActionEvent e) method

  • JMenu with text and icon

    Is it possible to create a JMenu with text and an icon where only the icon brings up the menu and the text behaves like a JMenuItem? How would you do this. Right now I have a JMenuItem next to a JMenu where the JMenu only has an icon. The problem with this is it is seemingly impossible to get them as close together as I would like. Any suggestions for solving the spacing issue would be equally helpfull. Thanks.

    From your previous thread you are aware that JMenu and JMenuItem both extend AbstractButton. So, you should be able to play with the borders and margins:
    setBorder(null);
    setMargin( new Insets(0, 0, 0, 0) );

  • Foreground Color of a Disabled AWT Component

    How do you change the foreground color of a disabled AWT component?

    You would have to write your own renderer that checkes to see if the component is enabled or disabled. Your renderer would then draw the component as you like in both of those states.

Maybe you are looking for

  • Adobe reader 6.0 app won't open because PowerPC apps are no longer supported

    I can no longer open .pdf files on my newer imac which is over 3 yrs. old,  This issue seemed to have started sometime after updating to icloud & Lion??  on this imac but for some reason, I do not have the same problem on my other imac that is runnin

  • The remote server returned an error

    hi Expert, New error I find now when trying to use dashboard application in B1. It sounds nice to have this new one since there is no info or solution in the SAP files or notes. The error message is the remote server returned an error : (407) proxy a

  • Web service registration problem

    Hi, I must use a web service in MII transaction. There is no problem about registration of web service In Ms-VisualStudio.Net environment , But problem in MII. After registration in VS.Net there is generated an .xsd file near .wsdl file. Is the probl

  • Setting Dimension Hierarchy

    Hi All gurus, I am new to OBIEE and am currently trying my hands on Oracle By example tutorial. My query is why do you need to create Dimension Heirarchy and different levels for dimension table and also what is the criteria which decides which level

  • What are the seven steps of Creation of Customs declaration

    Hi Friends, What are the seven steps of Creation of Customs declaration. Thanks in advance Suma