JOptionPane and showInputDialog display problem

Hi,
     I'm writing a graphing application for molecular spectroscopy. I create a JFrame which has a JDesktopPane. A graph is created by adding a JInternalFrame to the JDesktopPane. Each JInternalFrame has a JPanel in it on which the graph is painted. The JInternalFrames have JMenus that allow the user to change graph parameters like the font size and axis spacing. This is implemented by popping up a dialog when an option is selected from the menu. My problem is that the second time an option is selected, the dialog box that pops up is drawn incorrectly. The OK and Cancel buttons, along with the message, don't display. When I mouse over them, the buttons reappear, but not the message. I have tried creating the dialog with the following two lines of code:
String s = javax.swing.JOptionPane.showInputDialog(this,m,"Y Axis Spacing",javax.swing.JOptionPane.PLAIN_MESSAGE);and
String s = javax.swing.JOptionPane.showInputDialog(null,m,"Y Axis Spacing",javax.swing.JOptionPane.PLAIN_MESSAGE);     Finally, this may be related to an overall problem with the application. When the application loses focus and is partially hidden, the hidden area is not repainted when the focus is regained.
Thanks,
Tom Carroll
Bryn Mawr College Physics Department
[email protected]

I'm not sure to have understood your problem but try appling repaint() and validate method..
_Fabio                                                                                                                                                                                                       

Similar Messages

  • Help on assignment, don't understand JOptionPane and showInputDialog

    Hi, I am currently studying java and have problems doing my assignment. here is the assignment question. What I am looking for is pointers and hints to start on my assignment. I am not looking for the source code, rather the way to actually understand it and start writting my code
    I believe this assignment wanted me to create a class Object called Zeller with the methods in it and a ZellerTester to test the Object?
    I read up on the JOptionPane and the showInputDialog, but don't really quite understand it.
    Do i need a constructor for the Object Zeller?
    Does my assignment require me to put the showInputDialog as a method in the Zeller class? Or put it in the ZellerTester?
    The isLeapYear is a method in the Object Zeller?
    Here is the assignment question
    Examine the method
    showInputDialog() and study its function. Note the return type of this method.
    Write a program on the following requirements:
    1. Use the JOptionPane facility to ask the user for three positive integers,
    representing the day, month and year of a date.
    2. Use the Zeller�s congruence formula to find the day of the week.
    3. Should include a method boolean isLeapYear(int year)
    that will return true if year is a leap year, and false otherwise.
    The method should check for leap years as follow:
    return true if the year is divisible by 400.
    return true if the year is divisible by 4 but not by 100
    return false for the remaining values
    Thank you.

    I can't seems to return the method back to the main
    Not sure where has gone wrong...
    here is my code
    import javax.swing.*;
    public class ZellerTester
        public static void main(String[]args)
        int day  = 28;
        int month = 2;
        int year = 2007;
        int z;
        boolean isLeapYear;
        String[] displayName = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
        if(month==1 || month==2) {
            if (isLeapYear = false)
                day = day-1;
              else
                day = day-2;
        if(month<3)
            month = month + 12;
        z = (1 + day + (month * 2) + (3 * (month + 1) / 5) +
             year + year / 4 + year / 400 - year/ 100) % 7;
        System.out.println("The day is " +displayName[z]);
    public boolean isLeapYear(int year)
           if (year%400 == 0)
               return true;
           else if((year%4 == 0) && (year%100 != 0))
                return true;
           else
                 return false;
    }

  • Mid 2010 Macbook Pro sleep and external display problem

    I recently upgraded to the new 2010 15 inch core i7 Macbook Pro. The problem i have is that it will not detect an external display (23inch Cinema) after waking from sleep. This happens after using the display to extend the desktop and also when using the Macbook in closed mode.
    I've managed to get it to detect the display only after either restarting the Macbook completely or by going into energy saver and switching to dedicated graphics then going back to detect display.
    It seems that when on integrated graphics it doesn't register that an external display is connected. If i leave a program open and running that causes the dedicated graphics to kick in then it works ok. If i close all programs, shut the macbook pros lid, computer sleeps and external display shuts off. If i click the mouse to wake with lid closed, apple logo lights, machine starts up few seconds later macbook returns to sleep. If i open the screen the machine wakes as normal but the external monitor doesn't.
    Any help is much appreciated as its starting to frustrate me now...
    Many thanks
    oh and im running OSX 10.6.3

    I thought it was intermittent to begin with until i started looking into it. By leaving programs open, like aperture, before i put the machine to sleep it appears to wake the external monitor up without a problem. If i shut all programs or leave basic things open like safari and mail which don't require the dedicated graphics, then upon wake it wont register an external screen is connected.
    Manually detecting displays in settings doesn't work.
    Disconnecting and reconnecting mini display port doesn't work.
    Turning off power to cinema display and powering back up doesn't work.
    To get the display going again its either 1) turn off macbook pro and re-boot or 2) re-start the machine then the display is automatically recognised. Or 3) launch a programme that kicks in dedicated graphics then manually go in and detect displays again..... like magic the display then springs to life.
    No ideas anyone??

  • How to solve the flash Builder 4.6 scroll view and textinput  display problem?

    I have a dynamic form application which worked well on flash builder 4.5, having display problems in flash builder 4.6 now. What I did is adding
    TextInput objects  to a scroll view and set the texts for them dynamically. Everything is fine after the screen loaded. But if I scroll down, sometimes the texts will be placed in wrong positions. I attached the screen copy of the wrong display. Does anybody know how to solve this problem? Thanks.

    Check out the two threads below (if you have not already). I have not tried it but aeonus describes an approach that made me think of something that might work ... It is a workaround but, what if you have a text field (txtA) with the skin that does not allow soft keyboard selection, but does scroll correctly, and on the onClick event of that text field, you dynamically cover it with another text field (txtB) that does allow soft keyboard selection, (but does not scroll properly) and trigger the keyboard. After you get the entry from the user, set the value of txtA and destroy txtB ... leaving you (theoretically) with properly scrolling text fields. If you have a lot of those in your app, you might want to write a component that implements that behavior.
    "Create a dynamic textfield, and on click, invoke create a StageText instance at the same location as the textfield (by setting the StageText.viewPort property)
    Finally, set StageText.softKeyboardType to "numeric" and call StageText.assignFocus();"
    http://forums.adobe.com/thread/915019?tstart=0
    http://forums.adobe.com/thread/911214?tstart=0

  • 10.4.5 Update is out and fixes display problems.

    For all who have not updated yet:
    You can either on Apple.com/support/downloads get the Intel 10.4.5 update or the blue Apple in the left top corner of the screen click it and then software update.
    This will list all available updates depending on what is on your MAC.
    There is several Imac Intel users reporting fixes for their display problems ect. after installing the update + restarting.

    This fixes the problems except maybe for the 20" 256mb vram ones ????
    www.hardmac.com reports still some problems on one of theirs.

  • Rescue and Recovery display problem

    I'm running Rescue and Recovery 4.21.0016.00 and when I boot the R&R rescue media boot disk I come up with the screen that shows the options however the the image is too big to fit the screen. I've tried 2 different monitors but the program makes the image size too large so that I can't see all the options and pick what I wnat to do. I'm  running this on a IBM Netvista 8307-GU6. Any ideas out there????????

    I found another post for the same problem and found the fix. went into the BIOS and increased the display memory and that fixed my display problem. Now if I can just find out why the R&R program won't recognize the backup file when I boot from the CD I'll be happy. The backup file is on a USB drive and when I look at it from the Windows XP side it shows it being there but booting from the CD there are no backup files to restore from.  Any ideas????

  • Preview app and retina display problem after installing Maverick

    Hi everyone, i upgraded to Maverick yesterday and i now have a problem with the software "Preview 7.0". I've got a macbook pro 13" retina.
    Before Maverick i could visualise image in high resolution using Preview, and the 100% view was showing the image full quality. Now my Preview software acts like i'm not on retina and i can only visualise my images with the resolution of a standard monitor.
    Does it make sense ? Please help !!!

    I'm having the same issue with Preview not displaying images at the correct resolution.  If you also look at the info in Preview, there are metadata issues showing up.  Under "Creator's Contact Info" this is the info displayed.
    Creator's Contact Info: , CiAdrCtry, CiAdrExtadr, CiTelWork, CiUrlWork, CiAdrPcode, CiAdrRegion, CiAdrCity, CiEmailWork
    Something is broken with the program.
    Macbook pro retina 15" (late 2012)

  • Table layout and image display problems

    Im having a few problems at the moment, designing a layout
    using tables. I need to have 3 seperate tables, 1 for the left
    side, 1 for middle and 1 for the right. However I can only get the
    left and middle table on the same row, after that the right table
    jumps down to the next row.
    My second problem is with some images displaying in the
    preview. 3 images wont display, they are the same extension (.jpg),
    in the same folder as the rest but unlike the others wont display.
    I can swap them out for other images which display fine so I cant
    understand why they arent showing.
    Any help would be most appreciated.

    > Im having a few problems at the moment, designing a
    layout using tables. I
    > need
    > to have 3 seperate tables, 1 for the left side, 1 for
    middle and 1 for the
    > right. However I can only get the left and middle table
    on the same row,
    > after
    > that the right table jumps down to the next row.
    Use a three column, 1 row table, and put one of your tables
    into each of the
    three cells.
    > so I cant understand why they arent showing.
    Show us the page, please.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Isileth" <[email protected]> wrote in
    message
    news:ev0dpc$60t$[email protected]..
    > Im having a few problems at the moment, designing a
    layout using tables. I
    > need
    > to have 3 seperate tables, 1 for the left side, 1 for
    middle and 1 for the
    > right. However I can only get the left and middle table
    on the same row,
    > after
    > that the right table jumps down to the next row.
    >
    > My second problem is with some images displaying in the
    preview. 3 images
    > wont
    > display, they are the same extension (.jpg), in the same
    folder as the
    > rest but
    > unlike the others wont display. I can swap them out for
    other images which
    > display fine so I cant understand why they arent
    showing.
    >
    > Any help would be most appreciated.
    >

  • T60p, Vista and External Displays Problem

    I have a T60p with the ATI video running Vista that in the office gets dropped on a docking station and has 2 displays conncted to it, one through the DVI connection and one through the analog connection.  If I start the machine with it on the docking station it uses the DVI display as the primary and the VGA/analog one as the secondary.  That is fine.
    When I leave the office I use it as a laptop or sometimes at home I'll drop it on another docking station that doesn't have anything but a network connection and sometimes an external drive connected to it, and then RDP to it from one of my home machines.  When I come back to the office the display setup is always confused.  
    Usually it will reverse the 2 displays making the analog one the primary (this is very annoying), but sometimes it will only display to one of the external displays and sometimes it will just display to the built in display and to neither external display even though the thing is in the docking station and the lid closed.  Nothing seems to fix this when it happens... I can go to the display adaptor settings or the ATI control pannel and swap the display positions, but it still treats the analog as the primary (start menu, taskbar...) which I don't want, and if I reboot it it will go back to using the DVI as primary no matter what I leave the display settings at.
    Any ideas how to get it to do the same thing every time it's on the docking station in my office?  (I don't care what it does on the docking station at home, I if it's on that docking station it only gets RDP'ed into)

    Thinking out loud... is it possible it's the docking station?  One of my guys here at work has done a little research about similar problems one of our users is having and there appeares to be some evidence that swapping docking stations might fix it.

  • Win98se and winME display problems

    hey,
    it's been more then 6 months now, and i still cannot get my win98se working !!!
    (msi nForce: dual boot with win98se-winxppro, lucky for me winxp works like a charm)
    everything is working fine: sound, network, internet, ...
    untill i install the videodriver   8o
    i tried many different settings (like bios) and drivers, but the problem stays the same: after installing the display drivers (also with clean install from scratch), my computer just doesn't want to boot windows anymore, it stops just before entering windows ... so i go to safe-mode and uninstall driver and then it wants to boot normaly again
    i first thought it was the GPU, but now i have GF4 and still have this problem   :(
    yesterday i started all over again with winME:
    same problem ! ?(
    bios settings, driver issues, irq problem, APIC ?
    thx
    MSI nForce (K7N420pro)
    athlonXP 1900
    creative GF4 4400

    thx R,
    i never use those virus programs, my system is a clean msi nForce with nothing inside before (no usb, no pci and internet through nic) ...
    now the only thing i put inside is an creative GF4 4400
    what is it that i have to turn off in the bios ?
    i understand that winME is more like win98 3th edition ?
    and that why is giving me the same problems ?
    btw, the problem isn't exactly the same:
    in win98se it's just rebooted before loading win
    in winME my screen tuns off before loading win, i'm sure windows didn't load completely, because when i press alt-crtl-del 1 time, it rebootes ...
    greetings

  • 150 and Caller Display Problem

    Probably the easiest one to start with. When I dial "150" all I get is a recored message saying - "Sorry you cannot call that nunber from this line. Please ontact your service provider using the number given in their documentation"
    What's that all about?
    Secondly I added/ordered the "Bt Privacy" service last week but as of now the caller display aspect still isn't working. Do I need to wait longer or is it likely that there's been a problem?
    Thanks in advance.
    Griff
    Solved!
    Go to Solution.

    Are you sure that its still YOUR telephone number, and it has not been crossed with someone else?
    Try calling your number from a mobile, and see if it rings. Or call a mobile and see what number comes up.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Hierarchy and query display problem

    HI, SDNs
      i have met tw0 problems
    1) When create a hierarchy add a new char as a node, i can find the value of the char which is autually in the master data
    2) have three column in query A, B,C  C=A/B    as  A=100USD and B=50KG in  query , but the C display X  instead of 2USD/KG

    Hi,
    1: To add a new char, add the info object as external chars in the Info object maitainance scree --> hierarchy tab. Then go to create hierarcy option. Now it will add you to insert the info object as a node.
    2: Here you are mixing the Units in calculation.So you are getting the error as defined in TCODE RSCUSTV4. So as others given the idea, you can use the Data Function in a Formula (NO Dim).
    Happy Tony

  • Dreamweaver and CSS display problem

    Hi,
    I am new to CSS layouts and trying to build a site in pure
    CSS but I am having a problem with how it is dispayed within
    dreamweaver.
    here is
    the html page as it looks in a browser
    But
    here is how the page currently looks is dreamweaver
    As you can see, my divs which run along the bottom of the
    page in the browser are actually shown contained in another div in
    dreamweaver which is very misleading!
    Is this due to something i have done or is this how it
    displays in dreamweaver?
    HTML code as follows:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN"
    http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    <title>Untitled Document</title>
    <link href="lovellkits.css" rel="stylesheet"
    type="text/css">
    </head>
    <body>
    <div id="main">
    <div id="logo"></div>
    <div id="navbar">Nike Kits | Optimum Kits | Lovell
    Rugby Kits | Training Wear | Equipment</div>
    <div id="bannerlarge"></div>
    <div id="smlbanner1"></div>
    <div id="smlbanner2"></div>
    <div id="smlbanner3"></div>
    <div id="smlbanner4"></div>
    </div>
    </body>
    </html>
    and
    my CSS can be found here
    Thanks for reading
    Steve

    FWIW, there were significant rendering improvements made in
    DW8, so it
    may be worth the upgrade if you're creating layouts in DW.
    In the meantime, try adding some content to the bannerlarge
    container. I
    think DW may be incorrectly collapsing that tag since it's
    empty.
    HTH,
    Randy
    > Dreamwaever MX 2004 for the mac

  • Xml and css display problem

    I have 1 small problem I have created a CSS file to display the title elements of an xml file but the titles appears to right on top of each other.
    IE the titles symbol name last sales and net change % change and volume are all aligned on top of each other.
    Below is my code.
    quotes                                        {width: 750px; font-size: 12pt; margin: 20px}
    dateTime                              {display: block; position: absolute; top: 0px; left: 600px; font-size: 8pt}
    heading                              {display: block; font-size: 32pt; font-family: Arial, Helvetica, sans-serif; text-align: center; font-weight: bold}
    subHeading                         {display: block; font-size: 14pt; top: -10px; font-family: Arial, Helvetica, sans-serif; text-align: center;                               font-weight: bold}
    titles                                   {display: block; margin-bottom: 20px}
    column                              {display: inline; font-size: 8pt; text-decoration: underline; font-family: "Courier New", Courier, monospace}
    stock                               {display: block; border-bottom: 1px solid #000000; font-size: 10pt; font-family: "Courier New", Courier, monospace}
    symbol                                        {position: relative; left: 40px}
    #c1, column                         {position: absolute; left: 40px}
    #c2 , company                     {position: absolute; left: 130px}
    #c3, lastSale                         {position: absolute; left: 430px; width: 70px; text-align: right}
    #c4, netChange                         {position: absolute; left: 510px; width: 80px; text-align: right}
    #c5, pChange                         {position: absolute; left: 590px; width: 80px; text-align: right}
    #c6, volume                              {position: absolute; left: 640px; width: 100px; text-align: right}Edited by: user9311551 on Jan 16, 2012 5:20 PM

    FWIW, there were significant rendering improvements made in
    DW8, so it
    may be worth the upgrade if you're creating layouts in DW.
    In the meantime, try adding some content to the bannerlarge
    container. I
    think DW may be incorrectly collapsing that tag since it's
    empty.
    HTH,
    Randy
    > Dreamwaever MX 2004 for the mac

  • T60 2007-FUG ATI X1400 Windows 7 64-bit projector and external display problem

    I have Windows 7 64-bit Enterprise on my T60. I have tried to install many different ati drivers, but nothing seems to work. I cant use a projector or external display via VGA port. I heard that if I boot with a projector then it works ok.
    I have installed Ati Install Manager and so on. I have uninstalled drivers etc. I have search forums. I installed all updates from Lenovo site. BIOS is up to date. I installed X1400 driver from Windows update site. Driver date is 1.12.2008. I cant update it. Everything else works super.
    What to do?

    Looking at the ATI drivers on the T60 support site, I do not see one that supports Win7....don't know if there is a plan to.
    You probably have basic functionality with the Vista driver, but I would not imagine that all options will be available.
    If you cannot get the external VGA port to work through the Catalyst Control Center, then I would would chalk it up to a lack of Win7 support.
    Regards

Maybe you are looking for

  • Threaded Sudoku solver - Assignment question (NOT LOOKING FOR ANSWERS  )

    Hi All, I'm going to be upfront and point out this is an assignment that i'm currently working on and i'm not receiving much in the way of feedback from the class forums. This is currently a 4th year OO assignment for UNSW Australia. What I am having

  • Why are my book pages enlarged when I send them to be printed?

       I have created a 40-some page iPhoto book that looks fine when I scan the pages prior to sending it to be printed. However, I get an email from Apple saying that the book is unreadable or unprintable. Upon looking at the PDF version of the book, I

  • Does K8D Master-FT support Dual core Opteron?

    Hi, Does K8D Master-FT support dual core Opteron? I saw the latest BIOS was released at 2003/12/11 and said to support for all series of AMD Opteron(up to 248, SC, 2.2GHz/1M). Thx, Xuekun

  • Using digital projector with macbook

    A basic question from an escaped PC user. What keystroke is used to tell my macbook to send the display output to an external projector? I need the equivalent of the F8 key I used on my work supplied PC laptop I have purchased the link cable so the h

  • Sleep prevented by SB 0, SS 1, AS 1

    I ran into a situation this AM where 3 separate attempts to have my mid 2009 MBP sleep failed. Its running 10.6.3 I see these messages in kernel.log (and this is every message from the time period): May 7 05:39:14 mystic kernel[0]: CoreServicesUIAg[7