Please can u suggest to rectify the error in the method  JOptionPane.showMe

import javax.swing.JOptionPane;
public class Welcome4 {
// main method begins execution of Java
public static void main(String args[])
JOptionPane.showMessageDailog(
null, "Welcome\nto\njava\nProgramming");
System.exit(0);//terminate the application with window
} // end method main
after compiling this i got the error like this
F:\>
F:\>javac Welcome4.java
Welcome4.java:12: cannot find symbol
symbol : method showMessageDailog(<nulltype>,java.lang.String)
location: class javax.swing.JOptionPane
JOptionPane.showMessageDailog(
^
1 error
What shud i do pls suggestme

The first parameter of that method has to be the parent of the message dialog; you pass a null value and the compiler just is too stupid to realize that you intend to pass a special null value Component. You have to cast that null value explicitly: ((Component)null) so that the compiler will keep its mouth shut otherwise it treats a simple 'null' as its own type which is not what you want.
kind regards,
Jos

Similar Messages

  • The artwork for our podcast, "Japan Baseball Weekly," recently disappeared. The RSS feed info appears to be in order, any particular reason for this and what can be done to rectify the situation?

    The artwork for our podcast, "Japan Baseball Weekly," recently disappeared. The RSS feed info appears to be in order, any particular reason for this and what can be done to rectify the situation?

    Please always post the URLs of the Store page and the feed when you have a question. For reference, your feed is at
    http://www.japanesebaseball.com/services/jbw-podcasts.jsp
    and the Store page is at
    http://itunes.apple.com/gb/podcast/japan-baseball-weekly/id443149184
    Looking at the Store page, the image appears there perfectly well. On subscribing there is no image associated with the episodes because you haven't embedded an image in the files - please see this page for clarification:
    http://homepage.mac.com/rfwilmut/notes/coverart.html

  • How, please, can I get rid of the icons in the bookmarks toolbar so I have space for more bookmark names? Thank you

    I try to get as many items as I can in the bookmarks menu toolbar (typically using 3 letter names). F4 adds an icon next to each name - taking up valuable space. How, please, can I get rid of the icons in the bookmarks toolbar so I have space for more bookmark names? Thank you.

    If you remove the names then you may have a problem with organizing or searching for bookmarks.<br />
    If you do not want to use the extension then you can achieve the same effect with code in userChrome.css<br />
    That is what I would do.
    Add code to userChrome.css below the @namespace line.
    * http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #personal-bookmarks .toolbarbutton-icon { display:none !important;}
    </nowiki></pre>
    * http://kb.mozillazine.org/Editing_configuration
    * ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html

  • Hi, please can you tell me when the ipad mini 2 is coming out? i don't know whether to get the ipad mini, or wait for the 2nd generation

    hi, please can you tell me when the ipad mini 2 is coming out? i don't know whether to get the ipad mini, or wait for the 2nd generation

    Oh, ok. thanks for the help anyway

  • I bought an iPhone 5; 16GB and after updating to ios 7 am unable to bypass the activation screen because am told is locked to the owner's iCloud account but I can't contact the owner. What can i do to rectify the situation. Bought the phone for $500.

    I bought an iPhone 5; 16GB and after updating to ios 7 am unable to bypass the activation screen because am told is locked to the owner's iCloud account but I can't contact the owner. What can i do to rectify the situation. Bought the phone for $500.

    http://support.apple.com/kb/HT5818:
    What if I purchase a device that is still linked to the previous owner's account?
    Contact the previous owner as soon as possible and ask them to erase the device and remove it from their account. For complete instructions, read how to remove a device from a previous owner's account.

  • HT201628 so now i've followed this help now i can't re download itunes. i'm on 10.5.8. Still runs great but now i have no itunes. please can a suggestion be made that doesn't involve spending hundreds of pounds? i was only trying to get an iphone connecte

    i'm on MAC OS X 10.5.8. Still runs great but now i have no itunes as i've followed this post that covers my first issue. i've followed it correctly to the part of re install the latest version of itunes and i cant.
    i've been running logic pro on this mac and i have no issues so i've not upgraded software etc.
    i need a way around this problem without having to upgrade the OS if there is one.
    does anyone please have a suggestion that doesn't involve spending hundreds of pounds?
    i was only trying to get an iphone connected and this article says 10.6.8 or earlier?? it is definately earlier
    macbook - MAC OS X v 10.5.8...... trying to connect an iphone 4s os 6
    problem now..........need to re install itunes but can't probably due to my current OS.
    please help. i'm pretty gutted about this. i should of researched a little further me thinks. cheers guys

    said article below....
    HT1747: iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier
    Learn about iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier

  • HT1438 i keep getting SIM locked message on my iphone 4s and I need to unlock it please please can someone help me? The voice activation is on and when I type in what I think is the code It wont even put in the numbers

    I am trying to unlock my SIM from my iphone 4s, as I am getting a mesage SIM locked. How do I unlock this?Also I am typing in what I think my code is and it is not working. The voice activation wil not allow me to type in the numbers for some reason. I have turned it off and on about 7 times now. please please please can someone help me?

    If you bought the iphone in the US and it is locked to a specific carrier, then you can't use a different sim (from another carrier).  Is this your situation?
    Otherwise I'm not sure what you mean by "trying to unlock my SIM".  In which country did you buy the iphone?  Who's your carrier?

  • Seriously. I have been charged over £200 for supposedly free apps. I need to report this and cannot anywhere find how I can do this. In UK. Please can anyone point me in the right direction.

    Can anyone help. Especially Apple who don't seem to want to allow anyone to report a problem. It's taken me an hour to get this far. I've been charged nearly £100 for apps that are free in the app store - racing penguins for one which is free but billed to me at £6.99! How can I get a refund and stop this happening again...

    There is no subscription section in my account.
    I am paranoid after reading the above post but it seems there is no way to turn off initial purchases, only renewals can be turned off.
    1) Do all apps explicitly ask if you want to purchase a subscription and give the price?
         Is that required and controlled by Apple?
    2) Or is it possible an app will just charge and give you a subscription when
        a) the app is installed or b) when it is run the first time?
    If # 2 is a posibility then:
    We should be able to disable initial purchases so we don't wind up spending 100's by accident.
    Then if they are disabled we would have to re-enable them to get a subscription
      and after we could disable them again.  If #2 can happen that would be the only way to
      stop an accidental purchase from happining.
    Why - because I know from other places on the internet it ir Real Easy to miss
       something in the fine print no matter how dilligent you are about reading the Terms.
    Can someone answer the questions 1 & 2?
    And if 2 is possible - can anyone offer any advice (besides read carefully - I know that)?
    Thanks

  • How to call a java method so I can pass a file into the method

    I want to pass a file into a java method method from the main method. Can anyone give me some help as to how I pass the file into the method - do I pass the file name ? are there any special points I need to put in the methods signature etc ?
    FileReader file = new FileReader("Scores");
    BufferedReader infile = new BufferedReader(file);
    Where am I supposed to put the above text - in the main method or the one I want to pass the file into to?
    Thanks

    It's a matter of personal preference really. I would encapsulate all of the file-parsing logic in a separate class that implements an interface so that if in the future you want to start taking the integers from another source, e.g. a db, you wouldn't need to drastically alter your main application code. Probably something like this, (with an assumption that the numbers are delimited by a comma and a realisation that my file-handling routine sucks):
    public class MyApp{
    public static void main(String[] args){
    IntegerGather g = new FileIntegerGatherer();
    Integer[] result = g.getIntegers(args[0]);
    public interface IntegerGatherer{
    public Integer[] getIntegers(String location);
    import java.io.*;
    public class FileIntegerGatherer implements IntegerGatherer{
    public Integer[] getIntegers(String location){
    FileInputStream fs=null;
    try{
    File f = new File(location);
    fs = new FileInputStream(f);
    byte[] in = new byte[1024];
    StringBuffer sb = new StringBuffer();
    while((fs.read(in))!=-1){
    sb.append(new String(in));
    StringTokenizer st = new StringTokenizer(sb.toString(),",");
    Integer[] result = new Integer[st.countTokens()];
    int count = 0;
    while(st.hasMoreTokens()){
    result[count]=Integer.valueOf(st.nextToken());
    count++;
    catch(IOException e){
    //something sensible here
    finally{
    if(fs!=null){
    try{
    fs.close();
    catch(IOException f){
    return result;
    Once compiled you could invoke it as java MyApp c:\myInts.txt
    Sorry if there are typos in there, I don't have an ide open ;->

  • What can I do to rectify the situation in which Firefox will not open pdf files in the browser, even though I have already used all the help suggestions to no avail?

    I have tried everything Mozilla has suggested. Still when I click on a pdf, I get the message that the browser cannot open a pdf. I have gone through the help protocol, and it does not work.
    I have uninstalled Firefox and reinstalled it, and still not able to open pdf files within the browser.
    What else do I do, except go to IE or Chrome and just leave Firefox completely???

    A possible cause is the presence of a PDF plugin from an older Adobe Reader plugin in the plugins folder in the Firefox program folder.
    See [[Troubleshooting plugins]]
    See also:<br />
    http://kb2.adobe.com/cps/405/kb405461.html - The Adobe Acrobat/Reader cannot be used to view PDF files in a browser<br />
    http://kb2.adobe.com/cps/836/cpsid_83688.html - I can’t view a PDF document in my web browser<br />

  • Please can somebody, explain me about the swfObject

    Really, i am very new in this theme, i really don't understand why to embed swf flash as3 in html when i have seen videos where we can upload the swfs in a domain, please, i hope don't say something wrong.
    Thanks in advance
    Regards.
    Joselyn

    swfobject is just an industry standard way of embedding a Flash file into a web page because it handles all the browser differences internally and has a few other bonuses as well. Adobe even uses this in their own html-template file so they fully support this method.
    Can you do it without swfobject? Yes... but swfobject is just the recommended way.
    Some reference:
    https://code.google.com/p/swfobject/
    https://code.google.com/p/swfobject/wiki/faq
    https://groups.google.com/forum/?fromgroups#!forum/swfobject

  • Update to 10.9.5 has destroyed my Macbook Pro, please can someone help just getting the spinning disk whenever I ask it to do anything

    Hi,
    Updated a couple of weeks back an since my Mac has been almost unusable.
    Running a 2012 MacBook Pro 4GB Ram, Intel I5 2.5Ghz with a 750GB Harddrive. This is a home PC not a work machine, typically accessing internet over WI-FI and for 2 years has run like a dream.
    Seen some threads on here already about deleting the Open Directory Folder but seems to make little difference.
    Sadly I haven't taken a back-up for ages as haen't had my external drive plugged-in.
    Short of copying any pictures and docs elsewhere and starting a fresh I'm running out of ideas, anyone able to help?

    But the Yosemite beta is not open to the general public, just people that signed up until they reached a million testers.  So it is unlikely you can get a legal beta copy.
    Please post the EtreCheck output
    <https://discussions.apple.com/docs/DOC-6174>
    There is a chance you have software that is not playing nice on Mavericks.

  • PLEASE CAN YOU TELL ME WHAT THIS ERROR MEANS?

    The script attached to my button reads:-
    //This script takes the user to Scene 1 when opendoor is
    released
    on(Release) = function (){
    gotoAndStop("Scene 1", 1);
    The errors in the Output Panel are:-
    **Error** Scene=Scene 2, layer=door, frame=1:Line 2: '{'
    expected
    on(Release) = function () {
    **Error** Scene=Scene 2, layer=door, frame=1:Line 4:
    Statement must appear within on handler
    I will be eternally grateful to anyone who can sort me out!!

    SLMHILL wrote:
    > The script attached to my button reads:-
    >
    > //This script takes the user to Scene 1 when opendoor is
    released
    > on(Release) = function (){
    > gotoAndStop("Scene 1", 1);
    > };
    >
    > The errors in the Output Panel are:-
    >
    > **Error** Scene=Scene 2, layer=door, frame=1:Line 2: '{'
    expected
    > on(Release) = function () {
    >
    > **Error** Scene=Scene 2, layer=door, frame=1:Line 4:
    Statement must appear
    > within on handler
    > };
    >
    > I will be eternally grateful to anyone who can sort me
    out!!
    >
    >
    >
    SLMHILL,
    You're mixing two ways of writing event handlers. If you want
    to attach
    the script to your button directly, use this code:
    on(Release) {
    gotoAndStop("Scene 1", 1)
    Or, if you want to place all of the scripting in one place,
    on a frame
    on the main timeline, you would use the code below.
    opendoor.onRelease = function (){
    gotoAndStop("Scene 1", 1);
    To do this, make sure your button on the stage has an
    instance name of
    "opendoor" -- instance name is in the Properties panel.
    Then make a new layer called "actions" and make sure to click
    on it in
    the timeline, then open the Actions panel and write the code.

  • Please can you tell me if the signal is. Down for river ton in devon

    Iv had no signal since yesterday anyone else got same problem

    I have had no signal since lunchtime Friday 3rd July

  • How to rectify the error in running the apk file in emulator.

    hi
    I have developed the air based android application and got .apk file.I installed the .apk file in emulator which is version 2.3.1 android but i got the error
    when running it as
    "The Application HelloWorld Has Stopped Unexpectedly.  Please Try Again"
    How to rectify the problem.Please anybody help me with this what the exact problem in this...................
    thanks in advance.....................

    Hi Anson,
    You looked at old installation guide.
    I see you use old UI components which were released in May 2013.
    Important Note: Please use new UI with new SAP Fiori Launchpad
    New UI components have UI extension points and work with new SAP Fiori Launchpad.
    Please find correct components based on your Backend version.
    SAP Fiori - Add-on quick reference for transactional apps
    Regards, Masa
    SAP Customer Experience Group - CEG

Maybe you are looking for