Set the location of JOptionPane

Hi all,
i want to show a "JOptionPane.showConfirmDialog" in a specific location on the screen.
i need the location to be ABSOLUTE and not to be relative to the parent of the JOptionPane.
i tried to make an instance of the JOptionPane then apply the method "setLocation(int x , int y)" then show it using setVisible
but this don't work
so any suggestions ???!!!!
thanx in advance

experiment with x,y in this
(optionPane's middle will be at x,y)
import javax.swing.*;
class Testing
  public Testing()
    int x = 100,y = 80;
    JFrame f = new JFrame();
    f.setUndecorated(true);
    f.setBounds(x,y,0,0);
    f.setVisible(true);
    JOptionPane.showMessageDialog(f,"I should appear near: "+x+", "+y);
    System.exit(0);
  public static void main(String args[]){new Testing();}
}

Similar Messages

  • How to set the location of a button  (in an applet)

    Hello
    How do i set the location of the button
    forexample if i want to create a button in the middle of the applet, how would i do that
    Thanks :)

    supahsain08 wrote:
    Well i did this
    Triangle.setLocation(50, 100);
    (where Triangle is a buton)
    it doesn't do anything, stays at the same placeIt's all about context here and there are still many unknowns here that can effect your result and that you have not told us or shown us. My suggestion to you is to consider posting an SSCCE (Short, Self Contained, Correct (Compilable), Example, a condensed program similar to your current program in that it demonstrates the problem at hand, but is the smallest bit of code that still compiles and has no extra code that's not relevant to your problem. For more info on SSCCEs please look here:
    [http://homepage1.nifty.com/algafield/sscce.html|http://homepage1.nifty.com/algafield/sscce.html]
    Also, when posting your code, please use code tags so that your code will retain its formatting and be readable. To do this, you can will need to paste already formatted code into the forum, highlight this code, and then press the "code" button at the top of the forum Message editor prior to posting the message. You may want to click on the Preview tab to make sure that your code is formatted correctly. Another way is to place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
    [code]
      // your code block goes here.
      // note the differences between the tag at the top vs the bottom.
    [/code]or
    {code}
      // your code block goes here.
      // note here that the tags are the same.
    {code}good luck, pete

  • How to set the location of a button

    Hello
    How do i set the location of the button
    forexample if i want to create a button in the middle of the applet, how would i do that
    Thanks :)

    Do not make duplicate posts.
    http://forum.java.sun.com/thread.jspa?threadID=5293505&messageID=10240164#10240164

  • Where can i set the location of the LogonTicket cookies in the visual admin

    hello:
       where can i set the location of the LogonTicket cookies in the visual administrator?
    thanks!!

    Hi,
    When the SAP LOGON ticket Expired or if we need to update the dates, it is generally done at the Visual Administration Level. SAP Logon Ticket is represented as cookie in the Browser which will help us for SSO.
    In Visual Admin under keystore admin where our Old Portal certificate exists.
    We will need to delete the old portal certificate, then we need to generate new ceritificate and a pop box will appear.. where we need to provide our System details like SID, Client. After these details are given we can get a new certificate in which validity period dates are automatically generated. And also we can import teh same into Portal at Sys Admin->sys config->key store admin for it to be available as .PSE or .DER file for SSO.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/59bba290-0201-0010-468b-cd12efda573a
    check the above for EP security guide which might help you in the same.
    Regards,
    Ravi

  • How can i set the location of my pictures in photos app for mac osx?

    Not every photo I import into my MacBook have all the metadata in them. iPhoto allowed for setting the location, but in Photos I cannot manage to do so. Is there another way to do it or perhaps it's coming with an update?
    Thanks
    MacBook Mid-2010
    OSX Yosemite 10.10.3
    Photos 1.0

    Adding location data is not yet supported in Photos.
    And we do not know, if future updates will  support this feature. It might help, if you send back feedback to Apple with a feature request. You can use this form:  Apple - Photos - Feedback
    As a work-around, use third party apps to add location data before you import the photos to Photos.
    You could, for example, first import to iPhoto, add the locations, batch change the titles and captions, do all the things that are not yet supported in the new Photos, then export the photos from iPhoto and import them to Photos.
    Or use the free exiftool, if you like the Terminal.
    See:  http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#geotagging_exampl es
    To install exiftool: http://www.sno.phy.queensu.ca/%7Ephil/exiftool/install.html
    Other convenient apps are Jetphoto Studio, Geotagalog, there are many more ..
    I use Jetphoto Studio, but it is not free.

  • OMB command to set the location of an ODBC module

    I am writing OMB scripts to deploy an OWB project to a production environment.
    In the deployment script, I set the location of an Oracle module using the OMB commands :
    OMBALTER ORACLE_MODULE '<modulename>' ADD REFERENCE LOCATION '<locationname>' SET AS DEFAULT
    OMBALTER ORACLE_MODULE '<modulename>' SET PROPERTIES (DB_LOCATION) VALUES ('<locationname>')
    I also have an ODBC module for which I need to assign a location in the same way
    What is the OMB syntax to achieve this?
    OWB version 10.2.0.4

    You can use GATEWAY_MODULE for these. For example ...
    OMBALTER GATEWAY_MODULE '<modulename>' SET PROPERTIES (DB_LOCATION) VALUES ('<locationname>')
    Cheers
    David

  • Can anyone tell me how to remove the owner when setting the location

    Hello,
    Can anyone tell me how to remove the owner when setting the location?
    Properties
       Table Name:  (Table Name)
       Table Type:   Tables
       Owner:           Public
       Overridden Qualified Table Name:  (Table Name - same as above)
    Any help would be appreciated.
    Thanks
    Ann

    Hi Ann,
    please check this document to determine the correct space for your question:
    Find Topic Spaces on SCN (Forums)
    If you need help moving it, let me know!
    Thanks,
    Kristen

  • Setting the location in 5760

    I am trying to find a way to set the "location" information in the WAPs that are connected to the 5760. When I try to make the changes manually via the web interface, the changes don't stick. I have not found out how to make the changes via CLI. Any assistance in figuring this out would be greatly appreciated. 

    CCX Location Measurement Q – Default is off; enable if you use the CCX location features:
    ap dot11 24/5ghz rrm ccx location-measurement <cr>
    Use the no form to disable.
    Refer
    http://www.cisco.com/c/en/us/td/docs/wireless/technology/5760_deploy/CT5760_Controller_Deployment_Guide/Radio_Resource_Management_Configuration.html

  • How can I set the location of the files for My Digital Editions?

    When I installed REader for PC it set up as its file location  a location which makes no sense to me and I want to move it nto My Documents.  How do I do this without REader for PC "losing" its files?

    Adding location data is not yet supported in Photos.
    And we do not know, if future updates will  support this feature. It might help, if you send back feedback to Apple with a feature request. You can use this form:  Apple - Photos - Feedback
    As a work-around, use third party apps to add location data before you import the photos to Photos.
    You could, for example, first import to iPhoto, add the locations, batch change the titles and captions, do all the things that are not yet supported in the new Photos, then export the photos from iPhoto and import them to Photos.
    Or use the free exiftool, if you like the Terminal.
    See:  http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#geotagging_exampl es
    To install exiftool: http://www.sno.phy.queensu.ca/%7Ephil/exiftool/install.html
    Other convenient apps are Jetphoto Studio, Geotagalog, there are many more ..
    I use Jetphoto Studio, but it is not free.

  • SetLocation does not set the location

    Hi,
    I have just come to a very strange problem. I cloned a JComponent after implementing the Cloneable interface. The second object is moved across a work sheet and then setLocation is called on the first element using the second element's position, i.e.:
    JComponent c2 = c1.clone();
    c1.setLocation(c2.getLocation());
    The strange thing is that after this statement, the location of the first component is not changed. But if I use fixed constants, e.g.
    c1.setLocation(new Point(300, 300));
    everything works fine.
    I hope someone can help me as cloning seems to be the only method in my case (components can be user-implemented, so cannot use serialization)
    Tilman

    I tried c1.setLocation(new Point(c2.getLocation())); but without success. Meanwhile I found out, that the location of the first component is only set if the second component has a different location. I have the impression that both object somehow share an object that causes this problem because it has not be cloned.

  • Setting the location of HspEventLog.log

    Hi. Can anyone tell me how to change the location of HspEventLog.log? In our Development environment it currently resided at the root of C: which makes no sense at all. I suspect this is set using the configuration utility - correct? We are using Planning 9.2.
    Thanks
    Sean

    jts wrote:
    Sean,
    Trying a stab I had the same problem with planning logs and John told me the path set is in the regedit of your Planning server. In (going by memory) HKEY_Local_Machine/Software/Hyperion/Planning
    In here is two entries for error and out files. You know they are correct if they have a path of C:\
    JTSHi,
    Are you not getting confused with setting the error files for the standard planning web application, this is different than the hspeventlog.log which is created from using the planning desktop.
    It has been a while since I have used 9.2 but maybe it is defined in the planning desktop, the system folder setting?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can I set the location of iChat dialogue box on my desktop?

    When I use iChat it always opens a chat box in the upper left corner of my screen. I then drag it down to the lower right, where I want it, but it doesn't remember that position when I close it and open a new box.
    Is there a way to get iChat to always open the chat box in the same location where I want it?
    Thanks for any help.
    Greg

    Hi,
    Welcome to the    Discussions
    This is a yes and no answer.
    iChat will remember the place for Outgoing call whether they are Audio, Video or Text chats.
    This is always the place the last outgoing chats was when it was Closed and Ended
    Incoming Invite to be accepted are always in Standard places and cannot changed.
    Text Chats are Top Left of the Screen.
    Slightly lower are Audio Only chats.
    Video Chat Invites are always Top Centre. (Based on the External iSight being mounted top and centre and Internal iSights being in a similar position - so that it looks like you are looking somewhat towards the camera when watching your Buddy)
    Second invites when old invites are present or Chats in the case of Text chats are present will cause a sort of overlapping step effect to the left and downwards (much like any other app opening multiple windows).
    If you have Developers Tools Installed you get Property List Editor
    This can be used to Edit .plists
    I have had little success with trying to alter the positions of windows in iChat.
    9:18 PM Tuesday; July 28, 2009
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • Location for JOptionPane

    Is it possible to set the location of JOptionPane.showInputDialog/showMessageDialog with respect to the application .
    thanks

    JOptionPane.showInputDialog/showMessageDialog with respect to the application .it should center it on the parent component. are you using a null parent

  • Set location of JOptionPane

    How do I set the location of a JOptionpane relative to the parentComponent.
    Everytime I code a JOptionpane the default location is always the center of the Container. How can I adjust or set the location of were the JOptionpane is shown in the Container?

    There is a Swing forum for Swing related questions.
    A JOptionPane is just a JDialog. When you use one of the showXXX methods a JDialog is created and a pack() is done and setLocationRelativeTo(...) is used to position the JDialog.
    Take a look at the JOptionPane source code for the showOptionDialog(...) to see what all is involved in the above process. Then maybe you can create your own method that allows you to override the JDialogs default location.

  • How to set the font size in JOptionPane?

    I use a JOptionPane.showOptionDialog in a JClient form.
    Can I set the font size of the message in my JOptionPane?
    And also, can I set the location for each component in JOptionPane?

    The best way to do that is to create a seperate panel with its components in it (a JLabel with a specific font setting) and display that panel as the JOptionPane's message.
    As for the OK/Cancel/etc buttons, I don't think you'll be able to rearange them, without hacking into the JOptionPane class' source.

Maybe you are looking for

  • ISight not working (photo attached)

    Recently my built in iSlight is not working.. I follow the tip: When I turn my mac on, I have hold the power button for 5 seconds. I really did.... But then my Photo Booth or FaceTime is work just for 10 to 15 seconds before it's going off... What i

  • Trouble writing to /dev/pf using dlpi

    I have a user-mode program running on Solaris 8 that uses the dlpi interface to the fddi device, /dev/pf. The progam is unable to successfully transmit a message. When I use write(2), the message appears numerous times, perhaps 26, 320, 231, etc. I u

  • CDM 4650 / ACNS - List all files in a channel?

    Hello, I am looking for a non-cumbersome way to list all files in a channel. The only way I know of right now is to go to the CDM Admin Page, go to Previewer, and then view the channel, which is split among many pages and has much extraneous informat

  • CS6 Setup Errors and Warnings

    After running set up I've received the following errors and warnings: Error:          1310.Error writing to file: C:\Windows\Installer\d7e50.msi Error:          Install MSI payload failed with error 1603 - Fatal error during installation MSI Error:  

  • HT201366 The second hard driver (internal) was disappeared in my MacPro, after this update.

    I found an error message, "the second hard disk was ejected", when my MacPro was resrarted after this security update 2013-003 . The HD was diappreared in the system.  I cannot find it in finder, disk utility, and terminal.  The other problem I just