Help: How to use JWindow as Popup

Hi there,
I am developing a program & I wanted to design it with a screen like the Mac OS (tiger?) desktop. That is menu (button bar) at the bottom of the screen (the program's screen - Not the OS).
I thought I should use a JWindow to do it.
HOW I WOULD LIKE THE POPUP TO BEHAVE:
- Only appears when a user moves the mouse towards the bottom of the screen.
- To disappear (hide) when the user clicks somewhere else on the screen [when focus is lost(?)]
- To change its position relative to the program. That is, if the program is resized etc...
I NEED YOUR HELP ON
The design issues I should take into consideration. I mean interfaces I should implement etc...
Thanks in advance.
Yours,
Me

Okay, sorry for the late reply, I dont go on the net much.
With the focus issues, it could be very tricky to know when exactly the Window has lost focus cause a component within the window could still have the focus, hence the window would be in focus.
One way, could be to add a common FocusListener to all the components within the window by using a recursion method, and allow this FocusListener to determine when all the elements within the window have lost focus, so as to call the window hiding function
public void addFocusListener(Component c, FocusListener fl) {
  c.addFocusListener(fl);
  if(c instanceof Container) {
     Container cn = (Container)c;
     for(int i = 0; i < cn.getComponents().length; i++) {
         addFocusListener(cn.getComponent(i), fl);
// also the focus listener could be like this
class FocusChecker implements FocusListener {
   public void focusLost(FocusEvent e) {
      Component source = (Component)e.getSource();
      if(popupWindow.isAncestorOf(source)) {
          if(!popupWindow.isFocussed()) { // check if the window has a focussed component
             moveWindowIntoHiding();  // call the method to hide to window
}This is just a general guideline. Think around this to hide the window when it looses focus
ICE

Similar Messages

  • Need help how to use itunes card to download music

    Need help how to use itunes card to download music

    If you want to add the iTunes card to your account, then in the iTunes app on the iPad you should be able to scroll to the bottom of the Music tab and there should be a Redeem button - there is more info here : http://support.apple.com/kb/HT1574

  • How to use Sharepoint Modal Popup loader in Sharepoint-Hosted Apps

    Hi,
    I have a requirement to use a modal popup as loader in SharePoint-Hosted Apps. I have used this like following-
    SP.UI.ModalDialog.showWaitScreenWithNoClose(
    'Please Wait',
    'while we retrieve...',
    '400',
    '600');
    But it does not work if we have "SP.Js" and "SP.runtime.js" included in the page. If we remove the mentioned script, then only modal works, but other functionality related to "Sp.Js" does not work.
    Please let me know if there is any solution for the problem.
    Thanks in Advance.

    Hi,
    Chk out this link also
    http://stackoverflow.com/questions/4015159/using-jquery-to-display-a-modal-please-wait-dialog-box-message
    http://bernado-nguyen-hoan.com/2012/04/23/how-to-close-sharepoint-modal-wait-screen-after-postback-when-page-is-in-dialog-mode/
    http://sharepoint.stackexchange.com/questions/24391/how-do-i-show-a-loading-div-when-opening-a-modal-dialog-from-a-customaction
    http://blog.collabware.com/2012/10/30/tips-tricks-sharepoint-2010-modal-dialogs/
    Thanks
    Jaison A
    http://infomoss.blogspot.in

  • Help:how to use java.util.jar to zip or unzip a binary file.

    how to use java.util.jar to zip or unzip a binary file or a file contain native code.

    It may help you to know how I add JARs
    1. I open my Project (myProject)
    2. I Mount the JAR to the FileSystem (like mypackages.jar = which includes com.mus.de.myClass.java)
    3. I Mount the File to the FileSystem (like c:\..myfiles..\myProject)
    3.1 I add the File to my Project
    4. I select File | New -> Classes | Main
    4.1 I typed "import com.mus.de.myClass.java" to refer to this package.
    4.2 I called some of the public methods
    thats it
    Andreas

  • Anybody have any example on how to use javafx.stage.Popup

    I wants to popup an customerize UI stage to let user to something, and found there have a javafx.stage.Popup class. Any example for how to use it, seems it no titile bar and not OK and cancel button? Search for Forum seems don't find an useful one.
    Edited by: 931222 on Oct 22, 2012 8:54 AM

    follow up.

  • (Urgent)help: how to use sdk add a gif image into a pdf document

    I had use sdk plus-in add a new button of mine,if I click the button,a gif image will be inserted into the current page of pdf document
    My questions:
    one : When I clicked the button,there was a warnning box said:the image has not enough data.I don't known why?
    two : How can I be sure the position of the image which I inserted? and how to change it's position?
    three:  how to use sdk get the content of the document?

    hi Leonard:
    I do it like you said, but
    Why my image can not display in the pdf.
    code is:
    //====================================================================
    const ASInt32 theImageByteSize = IMG_WIDTH * IMG_HEIGHT;
    char* buff = new char[theImageByteSize];
    PDEImage volatile pdeImage = NULL;
    PDEImageAttrs pdeImageAttrs;
    PDEColorSpace pdeColorSpace;
    ASFixedMatrix imageMatrix;
    memset(&pdeImageAttrs, 0, sizeof(PDEImageAttrs));
    int hdl = _open(ImagePath, _O_RDONLY | _O_BINARY, _S_IWRITE | _S_IREAD);
    if (hdl == -1)
         AVAlertNote("[%s] create fail !!!!") ;
    if (_read(hdl, buff, theImageByteSize) == -1)
         AVAlertNote("read image fail!") ;
    pdeImageAttrs.width = IMG_WIDTH;
    pdeImageAttrs.height = IMG_HEIGHT;
    pdeImageAttrs.intent = ASAtomNull;
    pdeImageAttrs.bitsPerComponent = 8;
    pdeImageAttrs.flags = kPDEImageExternal | kPDEImageIsIndexed;
    pdeImageAttrs.decode[0] = fixedZero;
    pdeImageAttrs.decode[1] = fixedOne;
    pdeImageAttrs.decode[2] = fixedZero;
    pdeImageAttrs.decode[3] = fixedOne;
    pdeImageAttrs.decode[4] = fixedZero;
    pdeImageAttrs.decode[5] = fixedOne;
    ASFixedRect theMediaBox;
    PDPageGetMediaBox( AVPageViewGetPage(pageView), &theMediaBox );
    ASFixed theFixedWidth = (theMediaBox.right - theMediaBox.left);
    ASFixed theFixedHeight = (theMediaBox.top - theMediaBox.bottom);
    imageMatrix.a = ASInt16ToFixed(theFixedWidth);
    imageMatrix.d = ASInt16ToFixed(theFixedHeight);
    imageMatrix.b = imageMatrix.c = fixedZero;
    imageMatrix.h = 0;
    imageMatrix.v = 0;
    const Int32 cPaletteColors = 256;
    PDEIndexedColorData theIndexedData;
    theIndexedData.size = sizeof(theIndexedData);
    theIndexedData.baseCs = PDEColorSpaceCreateFromName(ASAtomFromString( "DeviceRGB"));
    theIndexedData.hival = cPaletteColors - 1;
    unsigned char data[3] = {255, 0, 0};
    theIndexedData.lookup = (char *)data;
    theIndexedData.lookupLen = cPaletteColors * 3;
    PDEColorSpaceStruct theColorData;
    theColorData.indexed = &theIndexedData;
    pdeColorSpace = PDEColorSpaceCreate(ASAtomFromString( "Indexed" ), &theColorData );
    pdeImage = PDEImageCreate(&pdeImageAttrs, sizeof(pdeImageAttrs), &imageMatrix,
                                                0, pdeColorSpace, NULL, NULL, NULL, (unsigned char*)buff, theImageByteSize);
    I want die, I had done this for so many days, My GIF doesn't insert into pdf,
    unsigned char data[3] = {255, 0, 0};
    theIndexedData.lookup = (char *)data;  "
    whether the data set wrong?
    I confused what I do next   

  • Need help: how to use "FileLock"

    Hi,
    I would like to be able to read the file at any time, but when
    write is acquired (assuming the lock is released), no read is allowed
    until the lock for the write is released.
    How to use FileLock to accomplish this scenario?
    Any input is appreciated.
    Thanks,
    Pin

    I would suppose that the first step would be to determine that the OS you are working on actually supports that...from the java docs...
    Platform dependencies
    Whether or not a lock actually prevents another program from accessing the content of the locked region is system-dependent and therefore unspecified.

  • Need help -how to use a GUI to compile a file

    hello peeps,
    I have this problem, let's get directly into it, i have a program that has GUI with a Text Area that im going to copy a text file into it (using JFileChooser FileReader and readLine() ...) so i have radio buttons like (view, compile and execute) and an OK button to get the selected option, what i want to know is how to compile the file that is in the text area, like how to get to the MS-dos console and javac to start. i hope this description is clear, and i'll be very appreciative for any help!

    thanks for your response, but its not working it keeps on throwing IOException, i tried to put a direct string into it like (Runtime.getRuntime().exec("javac MyClass.java"); and same thing happend. Am i missing something? like is there something to add before calling that line of code? i did import Runtime
    ok here is how my code looks like:
       if(compile.isSelected())
                       try
                       //name of the file im pasting into the text area  
                       String filename = file.getName();
                       Runtime.getRuntime().exec("javac" + filename);
                       catch (IOException e)
                         System.out.println("error compiling program");
                   }

  • Pls. help - How to use user defined URL?

    The page users access currently for login is (only over the Intranet)- http://servername/pls/portal30/url/page/pagename
    I need users to be able to point to - http://project.companyname.com/project
    and be taken to the above Login page.
    What needs to be setup (Apache/Portal)??
    I created a Virtual Hosts entry in the httpd.conf file -
    NameVirtualHost 13.xx.xx.xxx
    <VirtualHost 13.xx.xx.xxx>
    ServerName project.companyname.com
    </VirtualHost>
    That did not help. What am I missing?
    Thanks.

    ATP,
    Pls. refer Portal FAQ. Here is how it works
    Use the Apache Redirect directive in the <ORACLE_HOME>/Apache/Apache/conf/httpd.conf file. For example, if your site's full URL is http://mysite.us.oracle.com:80/pls/portal30, you can place the following directive in httpd.conf:
    Redirect /portalhome http://mysite.us.oracle.com:80/pls/portal30
    Then, if you try:
    http://mysite.us.oracle.com/portalhome
    you will be redirected to the original URL. This technique will also work with any valid path that is appended to the URL. For example:
    http://mysite.us.oracle.com/portalhome/url/folder/ONLINE_HELP
    will redirect the user to the Online Help content area.
    null

  • Help: How to use 'CRM_ORDER_MAINTAIN'

    Hi All,
    I want to create a sales order with following requirements.
    1) schedule lines having requesting dates for which vendor cannot deliver.
    2) change the status from open to some other status.
    i this i have to use
    'CRM_ORDER_MAINTAIN". but i want to know will this API takes care of updating ERP system?
    when i change the status will it also update the purchase order in ERP?
    And also give me some code as how to change status and change schedule lines using 'CRM_ORDER_MAINTAIN".
    Thanks in advance,
    Regards,
    Ujwalkumar

    Hi Robin,
    I am facing problem with CRM_ORDER_MAINTAIN.
    I am trying to change the status of service order from New to Shipped.
    Below is my code.Please look into it and let me the issue.
    Thanks.Rushikesh
    REPORT  ZRD1.
    data:IT_STATUS  TYPE  CRMT_STATUS_COMT,
         wa like line of it_status.
    DATA : ls_input_field         TYPE crmt_input_field,
           ls_input_field_names   TYPE crmt_input_field_names,
           lt_input_fields        TYPE crmt_input_field_tab,
           CT_PARTNER_ATTRIBUTES  TYPE CRMT_PARTNER_ATTRIBUTE_COM_TAB,
           l_i_orderadm_h         TYPE CRMT_ORDERADM_H_COMT,
           l_i_orderadm_i         TYPE CRMT_ORDERADM_I_COMT,
           l_i_obj_guids          TYPE CRMT_OBJECT_GUID_TAB,
           ls_i_obj_guids         like line of l_i_obj_guids.
    wa-REF_GUID = '47FDBF975F6100E1E10080000A0630A7'.
    wa-ref_kind = 'B'.
    wa-status = 'E0023'.
    wa-USER_STAT_PROC = 'ZRV_ST01'.
    wa-activate  = 'X'.
    APPEND wa TO it_status.
          ls_input_field-ref_guid = '47FDBF975F6100E1E10080000A0630A7'.
          ls_input_field-ref_kind = 'B'.
          ls_input_field_names-fieldname = 'REF_GUID'.
          INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
          ls_input_field_names-fieldname = 'REF_KIND'.
          INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
          ls_input_field_names-fieldname = 'STATUS'.
          INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
          ls_input_field_names-fieldname = 'USER_STAT_PROC'.
          INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
          ls_input_field_names-fieldname = 'ACTIVATE'.
          INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
          INSERT ls_input_field INTO TABLE lt_input_fields.
    *Start of solution1.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
          IT_STATUS                     = IT_STATUS
    CHANGING
       CT_INPUT_FIELDS                  = lt_INPUT_FIELDS
       ct_orderadm_h                    = l_i_orderadm_h
       ct_orderadm_i                    = l_i_orderadm_i
    EXCEPTIONS
          ERROR_OCCURRED                = 1
          DOCUMENT_LOCKED               = 2
          NO_CHANGE_ALLOWED             = 3
          NO_AUTHORITY                  = 4
          OTHERS                        = 5.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ls_i_obj_guids = '47FDBF975F6100E1E10080000A0630A7'.
    append ls_i_obj_guids to l_i_obj_guids.
    CALL FUNCTION 'CRM_ORDER_SAVE'
    EXPORTING
    it_objects_to_save = l_i_obj_guids
    EXCEPTIONS
    document_not_saved = 1.

  • Help : How to use list of values in Variable in ODI

    Dear All,
    I have a multiple values in table, and I would to use these values a a parameter in ODI to retrieve rows based on these values. As I know that we can use single value in variable in ODI.
    Any one can Help me please?

    Can't you use a join between the tables ?
    ODI mostly take advantage of native technologies.
    i.e If my source technology is oracle then i will create a join between the table i.e. MAINTABLE.column = LOVTABLE.COLUMN and also put a filter on LOVTABLE to take required values.
    OR you can write a subquery in the Filter i.e. MAINTABLE.COLUMN in ( Select LOVVALUES from LOVTABLE where LOVTABLE.ATTRIBUTE = 'BUSINESS_UNIT')

  • Please help how to use WITH query in UPDATE

    Hi Experts,
    Please help me.
    Thanks.

    Not sure about your required output. But try using WITH clause query inside SET clause of UPDATE statement.
       UPDATE SALES_REVENUE SR
        SET
                 (SR.TODAY_REV,
                 SR.TODAY_MARGIN,
                 SR.TODAY_UNIT
                 ) =
    (WITH result_sum_temp
    AS(
        SELECT SALE_ID, IN_TEAM, 1 SALE_FLAG, loc, seg,
            SUM(REV * rate) AS sum_rev,
            SUM(MARGIN * rate) AS sum_mar,
            SUM(UNIT) AS SUM_UNIT
        FROM SALES
        WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
        AND SALE_SPOT = 7
        AND SALE_ID = 375
        AND SALE_MODEL = 'D'
        AND IN_TEAM IS NOT NULL AND loc IS NOT NULL
        GROUP BY SALE_ID, IN_TEAM, loc, seg
         UNION ALL
        SELECT SALE_ID, OUT_TEAM, 2 SALE_FLAG, loc, seg,
            SUM(REV * rate) AS sum_rev,
            SUM(MARGIN * rate) AS sum_mar,
            SUM(UNIT) AS SUM_UNIT
        FROM SALES
        WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
        AND SALE_SPOT = 2
        AND SALE_ID = 375
        AND SALE_MODEL = 'D'
        AND OUT_TEAM IS NOT NULL AND loc IS NOT NULL
        GROUP BY SALE_ID, OUT_TEAM, loc, seg)
                    (SELECT   t.sum_rev, t.sum_mar, t.sum_unit
                       FROM   result_sum_temp t
                      WHERE       SR.SALE_ID = t.SALE_ID
                              AND SR.team_id = t.team_id
                              AND SR.SALE_FLAG = t.SALE_FLAG
                              AND SR.SEG = t.seg
                              AND SR.loc = t.loc
                              AND t.SALE_ID = 255)
        WHERE   SR.SALE_SPOT = 890
                AND SR.SALE_ID = 255
                AND (SR.SALE_ID, SR.team_id, SR.sale_flag, SR.SEGMENT, SR.LOB) IN
                          (SELECT   SALE_ID,
                                    team_id,
                                    sale_flag,
                                    seg,
                                    loc
                             FROM   result_sum_temp));

  • Help:how to use addAttachment method in NormalizedMessage

    i have a problem about the NormalizedMessage's addAttachment method ,it is below:
    public void addAttachment(java.lang.String id, javax.activation.DataHandler content) throws MessagingException
    i have a string .i want to transfer it to a certain SE as the attachment. how can I do!?
    i try to do it as below
    addAttachment("someid", new DataHandler(wantedString,"text/plain"))
    it does works in my computer with Window OS. however it DOESNOT WORK in Linux OS.?why?
    who can give me the correct using about DataHandler?
    many thanks .

    Why can't you just assign the method's return value to a variable and then print that? A bit of scriptlet code will do the trick. (As much as we all hate to use scriptlet code.)
    I believe you'll be able to do what you want in the 1.1 standard JSTL, but for now this will suffice. - MOD

  • Plz Help : How to use FrameGrabbingControl to extract frame from video.

    I m trying to extract frame from the video (from .mpg file)using FrameGrabbingControl on the click of the button.There is no problem related to playing video.
    import javax.media.control.*
    public void actionperformed(ActionEvent ae)
    String s = ae.getActionCommand();
    if(s.equals("click") )
    FrameGrabbingControl fgc = (FrameGrabbingControl) player.getcontrol("FrameGrabbingControl"); //it is returning null
    Buffer bf = fgc.grabFrame(); // so here nullpointerException
    }

    hi I am also experiencing the same prob.can u send me the code if u got one..my mail id is [email protected].we are working on a proj to extract jpeg images from any movie file in jmf...can u help us

  • Help - How to use kioskmode=true?

    This is from a previous post - but I'm not sure what it means. - I've never iweb, but thought someone here might know the answer.
    Your friend has disabled QT Pro saving by using the special html tags (kioskmode="true") in the page source.
    His code also determines the "size" of the player window.
    You'll need to dig through the page source code to find the URL to the .mov file and open it directly via QuickTime Player's "Open URL" feature.
    This may allow saving and full screen playback.
    Basically i've saved a QT movie from FCP and have uploaded to an FTP site.
    I'd like to disable to download triangle in the quicktime window, so the viewer can't save it. - but I don't know how to get into the page source.
    What am I missing?

    http://java.sun.com/docs/books/tutorial/uiswing/misc/plaf.html
    http://java.sun.com/products/jfc/tsc/articles/architecture/
    Try these

Maybe you are looking for

  • Ipod not being shown in itunes

    Hello all, please please please help me if you can. I have an ipod video 30gb and it started to behave erratically the other day (freezing up, missing songs on play-list and not even playing some when selected), when I connected to itunes a message t

  • My Windows 7 can't find the drivers for a plug and play wireless mouse and keyboard

    I tried it on Mac and a windows desktop it worked instantly. Please help me, what should i do? OS X 10.8.4

  • How to change the document page size in a PDF?

    OK can't figure a way to do this and hoping it's still possible. On mac snow leopard, adobe X pro. Use to be able to resize the pages in a pdf by printing to the pdf distiller. As this is no longer possible how do I accomplish this? I often have docu

  • Variable in *.as

    I have a variable in a .as file named var Current_Month:Number = CurrentDate.getMonth(); I was wandering if i can overrite the value using a outside HTML link <a href="LINK TO FLASH WERE THE MONTH IS OCTUBER"> Thaks

  • JFrame -- maximized window

    Hi, does anyone know, how to maximize JFrame window?        JFrame frame = new JFrame(); //        frame.pack();         frame.setSize(  ???  );         frame.setVisible(true);Thanks in advance. Lokutus.