My swing dialogs show up off-screen!

I am investigating JWS and looking into whether my company would like to adopt it as our new "standard method" for distributing various existing and future in-house utility applications. A primary concern is not needing to rewrite any existing code (just providing a better way to get at it).
JWS was looking pretty good as I successfully deployed one existing application. But the dialogs are not usable...
Brief "History" of this App (maybe relevant): It is an application where the first thing user needs to do is open a dialog and enter some info. There are also other dialogs (error, yes/no, etc) Swing modal dialogs have an issue where they do not center w/resp.to the parent as they should. (Reference: I remember hearing many complaints in the Swing Forum) So when I was writing this application I overcame the centering problem by manually calculating the proper (centered) position for the dialog. And it worked beautifully when run from the commandline.
But now that I run it with JWS, the dialog appears but seems to be centered about (0,0) of my screen, which means that 3/4 of it is not visible. It so happens that I can hit its Cancel button, otherwise I would not be able to do anything to close it. I can't move it (because the title bar is out of sight).
Is there a workaround for this? Is there a workaround that does not involve changing existing code?
Thanks,
/Mel

Even though one of my primary objectives is to not have to change existing code and have it work as-is from JWS, I did test the setLocationRelativeTo method (the code was calling setLocation method before with calculated relative location).
The dialogs still show up off the screen.
Next test is to download the 1.2 beta version (I am hoping that the couple of troubles I am still having will be fixed by using the newer version)....

Similar Messages

  • Dialog boxes appear off screen

    Hi!
    I'm using Illustrator CC on a MacBook Pro. I use an external monitor as a second screen and usually move the application frame to the external monitor and work there. I started having the follwing problem: when I try to save or open a file, the dialogue box appears slightly off screen, so that I can't for instance type in a new file name, because I can't get to that part of the dialogue box.
    I have tried switching between different screen modes, but it doesn't help. Also I can't manually move the dialog box - which also seems strange.
    My external monitor is a NEC MultiSync EA273WM.
    Any idea what could be the problem or how to solve it? It's slowly driving me mad...
    Thanks in advance!

    Harlev schrieb:
    Any idea what could be the problem or how to solve it? It's slowly driving me mad...
    At the moment it looks like the problem is called 10.10.2
    You can read through the posts of last week on this forum, but I'm afraid you won't find a solution.

  • Import dialog box displaying off screen

    When I'm in the office, I work in a dual-monitor environment.
    However, when working at home, I have only my laptop monitor.
    If I need to import something - html file, template file,
    etc. - the dialog box is displaying off screen.
    I've shut down and restarted, but still the same result. When
    I try to resize the RH window, it resizes off screen.
    My display properties indicate only one monitor.
    How to fix?
    Thanks!
    Cindy

    Hi Cindy
    Sounds like you need some multiple monitor managing software.
    Try these:
    MultiMon (Free)
    click here
    UltraMon (Paid)
    click here
    Other than that, you can try flying blind and navigating
    using the keyboard or maybe bump your resolution to the highest
    possible setting and perhaps that will bring the dialog either
    partially or totally into view.
    Cheers... Rick

  • Adobe Illustrator cc my open file and save dialog windows appear off screen

    How do I fix this?

    Figured it out. on a MAC holding down cmd-option-shift + Q did the job after logging back in.

  • Saving an off screen Swing JPanel to a BufferedImage

    First, thanks for reading this. I have read through almost the whole forum and tried countless deviations of examples given here, but to no success.
    The situation is that from an Java 1.3 Applet, I am creating the ability for a user to create a simple graphic using standard Swing JTextArea components. This gives him/her the ability to place text arbitrarily on an JPanel. This works fine. The problem comes when the user wants to preview the image with the parametes replaced in the JTextAreas.
    We are generating GIF files after the user puts in the data. The problem occurs when we create an off screen JPanel with new JTextAreas with the parameters replaced with the test data filled in. We seem unable to create a BufferedImage from the un-shown JPanel.
    I have tried putting the JPanel in a JFrame and showing it before I call paint/print, etc. The only thing that seems to happen is that the JPanel background color is rendered to the GIF file, but not the JTextAreas on the JPanel. I have sucessfully written directly to the Graphics of the JPanel using drawString and generated a GIF, but that does not accomplish our goal.
    Any help would be appreciated. A test routine is included to give you the code. TIA.
    Kurt
    void test() {
    int height = 400;
    int width = 400;
    JFrame jf = new JFrame();
    jf.setBounds(0, 0, width, height);
    JPanel p = new JPanel();
    p.setBackground(Color.blue);
    p.setSize(width,height);
    JTextArea ta = new JTextArea();
    ta.setBackground(Color.black);
    ta.setForeground(Color.red);
    ta.setText("This is the text to set");
    ta.setColumns(10);
    ta.setRows(3);
    ta.setEditable(true);
    ta.setEnabled(true);
    ta.setVisible(true);
    p.add(ta);
    p.validate();
    jf.getContentPane().add(p);
    jf.validate();
    saveToFile(p);
    // This was taken and slightly modified for the AnimagedGifEncoder
    void saveToFile(JComponent source) {
    int w = source.getWidth();
    int h = source.getHeight();
    int type = BufferedImage.TYPE_INT_RGB;
    BufferedImage image = new BufferedImage(w, h, type);
    Graphics2D g2 = image.createGraphics();
    source.paint(g2);
    g2.dispose();
    AnimatedGifEncoder gif = new AnimatedGifEncoder();
    gif.start("D:/tmp/gifs/mygif.gif");
    gif.setDelay(1000);
    gif.addFrame(image);
    gif.finish();

    Your approach "putting the JPanel in a JFrame and showing it before I call paint/print" was ok, but it must be done in another thread, this sample is doing a similar job.
    You will see that when the print dialog is shown, the frame is fully visible with the button,
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.print.*;
    public class PrintF extends JFrame
         JPanel  pan = new JPanel();
         JButton pri = new JButton("Print");
         JButton b1 = new JButton("The Click");
    public PrintF()
         super("This is a full frame print test");
         setBounds(1,1,500,350);     
         addWindowListener(new WindowAdapter()
        {     public void windowClosing(WindowEvent ev)
                   dispose();     
                   System.exit(0);
         getContentPane().add("Center",pan);
         pan.setBackground(Color.white);
         pan.add(new JLabel("Label 1"));
         pan.add(pri);
         pri.addActionListener(new ActionListener()
         {     public void actionPerformed( ActionEvent e )
                   TheT t = new TheT(b1);
    //               printIt(); 
         setVisible(true);
    public class TheT extends Thread  implements Printable
         JFrame  frame = new JFrame("The printed frame");  
    public TheT(JButton b)
         frame.setBounds(50,50,400,350);     
         frame.getContentPane().setLayout(null);     
         frame.getContentPane().add(b);
         b.setBounds(20,80,150,30);     
         start();
    public void run()
         frame.setVisible(true);
         printIt(); 
         frame.dispose();
    private void printIt()
         PrinterJob pj = PrinterJob.getPrinterJob();  
         PageFormat pf = pj.defaultPage();
         pf.setOrientation(pf.LANDSCAPE);
         pj.setPrintable(this,pf);
         if (pj.printDialog())
              try
                   pj.print();
              catch (Exception e){}    
    public int print(Graphics g, PageFormat pf, int pi)
                                                throws PrinterException
         if (pi > 0)
              setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
              return Printable.NO_SUCH_PAGE;
         setCursor(new Cursor(Cursor.WAIT_CURSOR));
         g.translate((int)pf.getImageableX()+2,(int)pf.getImageableY()+2);
         try
              Robot     r     = new Robot();
              Rectangle rect  = frame.getBounds();
              Image     image = r.createScreenCapture(rect);
              g.drawImage(image,2,2,null);
         catch(AWTException awe)
              System.out.println("robot excepton occurred");
         return(Printable.PAGE_EXISTS);
    public static void main (String[] args)
         new PrintF();  
    }       Noah

  • I was trying to make a new screen recording using quicktimeplay, but when I watched the video after recording it all I could hear was me talking while the video was showing on the screen. How do I turn off that recording and turn the right one on? thanks

    I was trying to make a new screen recording using quicktimeplay, but when I watched the video after recording it all I could hear was me talking while the video was showing on the screen. How do I turn off that recording and turn the right one on? thanks

    Hi j2399123,
    It sounds like your screen recording is doing what it was designed to do, capture what is happening on your screen, with optional voice over with the microphone.
    Screen recording is for recording what you see on the screen, it is not a "video capture" option, like for capturing a movie with sound that is playing on your screen.
    For the QuickTime recording options, check out "Recording with QuickTime Player" in
    Mac Basics: QuickTime Player creates, plays, edits, and shares video and audio files
    http://support.apple.com/kb/ht4024
    And for screen recording specifically, there's
    QuickTime Player 10.x: Record your computer’s screen
    http://support.apple.com/kb/PH5882
    Thank you for thinking of Apple Support Communities for your support needs.
    Nubz

  • How do I use serial port read and show text, but not have it scroll off screen?

    I am new-ish/returning amateur user of Labview and I am trying to edit the example VI "Advanced serial write and read VI" that is part of dev suite 2012.  I need to use the string box to show ALL text received from serial port, always appending and only rolls off screen when more real data arrives at serial port. 
    What is actually happening is as more bytes (or no bytes AT ALL!) arrive during read time, current text rolls off the string box.  Even when 0 bytes are received, screen is blanked out.  I am not very familiar with functions locations and even worse at understanding obscure references to functions, so please keep replies very basic so I can follow.
    Just to be clear, I need the string window to behave like hyperterm does-always shows data and it is not pushed out of window arbitrarily.
    Thanks,
    Steve  
    Solved!
    Go to Solution.

    OK- lets start back at the beginning.  I have a few questions...
    WHy does incoming txt get placed at top of txt box and then scroll up?  why would it make more sense to input at the bottom and scroll toward the top.  I have created this huge txt box that appears to be impossible to use.
    I have attached example of txt boxes I have tried, and pic of VI I have edited.  Bad marks for uglyness....
    Attachments:
    Capture_VI.JPG ‏117 KB
    Capture_VI2.JPG ‏133 KB

  • I have iphone 4s with iO6. My problem is I can no longer update my apps since "cannot connect to itunes" always shows on my screen when i try to. Tried fixing by changing the dates, turning off location as suggested in some forums but both didn't work!

    I have iphone 4s with iO6. My problem is I can no longer update my apps since "cannot connect to itunes store" always shows on my screen when i try to. Tried fixing by changing the dates, turning off location as suggested in some forums but both didn't work!  Please help!! Thanks.

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • I don't know what's wrong with my 3GS. It only shows the black screen with white apple. Turning it on then off doesn't help.

    I don't know what's wrong with my 3GS. It only shows the black screen with white apple. Home button and turning the phone off then on doesn't seem to do anything.

    Thanks Lucas,
    I've tried doing that with no results. Same screen keeps showing. Maybe it'd be more helpful if I told you a bit more info.  My phone was randomly playing music, and the voice control would also suddenly start without me touching the phone.  Then I let the battery die and started to recharge when on the screen it indicated to plug into my computer/iTunes, I tried to restore but was getting an error message (can't remember what it said now). Battery died and now my current issue of the black screen with white apple.  I'd love to be able to restore my phone but now its not showing as a device on my iTunes. HELP! Any other suggestions?

  • What do i do if my ipod wont turn on/off, shows a white screen, wont do anything, and wont connect to itunes

    what do i do if my ipod touch wont turn on/off, shows a white screen, wont do anything, and will not connect to itunes

    Let the battery fully drain. After charging for an hour try a reset
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    and restore as necessary.

  • My ipad is freez...it only show a home screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    my ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    Have you tried to reset it? Hold down the sleep and home keys for about 20 seconds and see if you can get it to reboot.

  • My ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.

    my ipad is freez...it only show a fome screen. but i can turn off my ipad but not shut down...and i went to my computer and i go to itune. i try to restart my ipad but it say turn off your.find my iphone..but i cant my ipad is freezing.can help me plz.plz help me.................thx u

    Option 1
    Try force iPad into Recovery Mode. Follow step 1 to 6 very closely.
    http://support.apple.com/kb/HT1808
    Note: You need to be patient and repeat the above many times to recover your iPad

  • My ipod shows a blue screen and then turns off and wont turn back on. What should I do?

    I turned on my iPod touch today and it turned on as usual. I unlocked it and went to play a game. I got tired of the game after about 5 mins so I went to the home screen. I swiped to the previous screen and it showed a blue screen after about 3 seconds. I was sort of surprised as this hadn't ever happened before. It didn't turn itself off so I pressed and held the power and home buttons. It turned off after three seconds. I tried to turn it back on but it wouldn't turn back on. I remembered about what someone said about pressing and holding the power button and the home button. I did so and as expected it turned back on. I unlocked it and the same thing happened again. Blue screen! I turned it off and tried the same thing again. Yet this time when it got to the lock screen, I pressed and held the power button and slid to power off. I didn't want to try turning it on again so I asked this question. WHY DOES MY IPOD SHOW A BLUE SCREEN? (Over and over agin every time I turn it on?) Please help!

    Try:                                               
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable       
    - Try on another computer                            
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar                              

  • My i touch fell on the floor and is just showing a grey screen.  Can't scroll to turn off or view anything on the screen

    my i touch fell on the floor and is just showing a grey screen.  Can't scroll to turn off or view anything on the screen

    Try here:
    iPod touch: Hardware troubleshooting
    However, you likely have a hardware problem since it started after dropping the iPod.  If the toubleshooting does not solve the peroblem then make an appointment at the Genius Bar of an Apple store.

  • I was watching something on my iPad then it suddenly turned off I put it in charge and it turned back on then showed the home screen then turns back off quickly so I can't restore it

    I was watching something on my iPad then it suddenly turned off I put it in charge and it turned back on then showed the home screen then turns back off quickly so I can't restore it

    Hi there iPad 3rd Generation,
    You may find the troubleshooting steps in the article below helpful.
    iOS: Not responding or does not turn on
    http://support.apple.com/kb/ts3281
    -Griff W. 

Maybe you are looking for