Please help! brand new to java - changing fonts

i want to change the some of the font attributes on a label
i tried doing it this way but it wouldn't work
Label lblCompany = new Label("Reasonable Computers");
Font myFont = new Font("Times New Roman", Font.Bold, 24);
lblCompany.setFont(myFont);
^
it tells me that there is an identifier expected at that point
what i am doing wrong?

I've had the same problem yesterday, and i thought it was a problem with java.
But I tried to put this method call in some function (like the constructor) instead of putting it at the root of my class, and now it works fine.
See if you don't call this method out of a function , maybe it's the same problem.
Hope it can help !

Similar Messages

  • Please help - Brand new X1 Carbon defective out of the box - is this normal? what should I do next?

    Hello all,
    So, as a loyal Lenovo customer I decided to purchase the X1 Carbon 2nd Gen (non-touch, I5 version).
    Last week I finally received it.
    Unfortunately, the first thing I noticed was a defective touchpad - very loose, the right bottom corner was not solid
    enough and made a weird noise while clicking it. It drove me crazy since I am used to the top build quality the Thinkpad series offers.
    I took to the local Lenovo service center, they actually replaced it on the spot and it made it better, not great but better. I still think there is something wrong there, since the bottom two "buttons" don't feet and sound as good as the upper ones.
    But that I can tolarate.
    The thing that really pissed me off was this: To me demise, after using the laptop in a dark room I noticed this massive screen bleed :
    (apologize for the ling stream of pics, didn't know how to thumbnail them)
    My question to you guys, is this okay? is this an acceptable bleed? or should I do whatever it takes to get it repaired/replaced?
    I just hope they will know how to handle this here at local center, as from my experience dealing with computer reps here, the local Lenovo agent (which is actually the importer)  will not replace it for me (their excuse is that it wasn't bought in this country)
    This is amazing, in one year Lenovo has lost it's entire reputation over the 2nd Gen X1 carbon.
    Please help me. what should I do?
    Thank you very much.

    The official method of creating / escalating to a complaint is to call support, with previous call numbers handy, and request the representative to escalate your case to a complaint.  They will then create a complaint on your behalf and also be able to inform you about the complaints proceedure.
    Andy  ______________________________________
    Please remember to come back and mark the post that you feel solved your question as the solution, it earns the member + points
    Did you find a post helpfull? You can thank the member by clicking on the star to the left awarding them Kudos Please add your type, model number and OS to your signature, it helps to help you. Forum Search Option T430 2347-G7U W8 x64, Yoga 10 HD+, Tablet 1838-2BG, T61p 6460-67G W7 x64, T43p 2668-G2G XP, T23 2647-9LG XP, plus a few more. FYI Unsolicited Personal Messages will be ignored.
      Deutsche Community     Comunidad en Español    English Community Русскоязычное Сообщество
    PepperonI blog 

  • Please Help: Brand new to Logic and Mac at the same time

    Dear Board,
    I joined the Mac family yesterday and have done pretty well with getting Logic and Cubase 4 installed on the Mac. (It's like trying to learn Spanish when you're from Alabama)
    However, when I assign an instrument track to ESX sampler, no libraries or presets come up. I can hear one sound, but when I pull down the menu to load another sound, there are no other sounds to be found. Do I have them stored in the wrong place or did they not automatically load when I installed Logic?
    Specifically, I am looking for a decent acoustic piano sound, but can't make it work.
    I migrated from Logic 5 on PC to this setup yesterday, so it's all new to me. Any help you can give will be appreciated.
    Thanks,
    B3
    Mac Pro   Mac OS X (10.4.8)   Logic 7.2

    Well a fellow Las Vegan, that is something I
    havent seen since I have been on this forum.
    Anyway welcome and good choice to go with
    Logic Pro 7. This app is a constant challenge.
    First I have to ask an obvious question, did you
    install the contents disc? That is the one with all
    the samples on it. Since you have been using a
    different version, I assume you know how the
    EXS works so that should not be the issue.
    If you click on the black area no menus come up?
    Or do empty menus come up? We will get it going,
    this sounds like misplaced files. Phil

  • Please help - Brand new 8831 conf phone won't boot

    Not sure how to troubleshoot these new phones, but when I power the phone via wall power (power cube) or 48v POE, the phone LEDs stay on for a second or two then go out, and then the phone does nothing.  No display or additional blinking lights - nothing.  At first I thought it was a bad power cube, so I tested on a working POE, and nothing.  I'm wondering if this was shipped DOA or what.  Any suggestions would be greatly appreciated!

    Hi,
    Try the suggestions as per the following post including a factory reset, if it still fails it will need a RMA.
    https://supportforums.cisco.com/discussion/11947981/8831-doesnt-boot
    HTH
    Manish

  • Change A String Sentence -- Brand new to Java!

    Hello --
    I am brand new to Java, so please excuse my ignorance ...
    i'm working on a very simple project at school, so i dont need any high tech ways of doing this.. lol ... the program prompts the user to enter a sentence .... the program takes this sentence and outputs the first word of the sentence and moves it to the last word of the sentence .... for example:
    user enters: hello how are you today
    the program outputs it: how are you today hello
    this is a practice exercise, but im having trouble .... new student here!! help! lol
    thanks,
    cindy :)

    ok,
    assuming you have the reading the input part and stuff. the most straight forward and explainative way is :
    1. break the sentence into an array of words
    2. print the last word
    3. etc.
    use the java.util.StringTokenizer class. A sentence is a series of words delimited by <space>. String Tokenizer is used like java.util.Enumeration.
    In this case we are going to read the tokens/words in to an array, then you can print them in what ever order.
    like this
    import java.io.*;
    import java.util.*;
    public class wordswitch {
    public static void main(String[] args) {
    String sentence = new String();
    // get the sentence
    System.out.println("enter a sentence : ");
    try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    sentence = reader.readLine();
    reader.close();
    } catch( Exception e ) {
    System.out.println("Exception : "+e.getMessage());
    // convert the Sentence in to an array of words
    StringTokenizer strTok = new StringTokenizer(sentence, " ");
    int numWords = strTok.countTokens();
    String [] words = new String[numWords];
    int i=0;
    while( strTok.hasMoreTokens() )
    words[i++] = new String(strTok.nextToken());
    // display the new sentence
    if( numWords < 2 ) // if there is 1 or 0 words just echo back the original sentence
    System.out.println(sentence);
    else {
    // print the words in the new order
    System.out.print( words[numWords-1]+" " ); // last word first
    for( i=1; i<numWords-1; i++ ) // the second word the the second from last word
    System.out.print( words[i]+" " );
    System.out.println(words[0]); // the first word last

  • For those who have problems RE: My iPhone 4 on connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??

    For those who have problems RE: My iPhone 4 connecting to my pc shows my friends name in the DIGITAL camera Drive..It dsiplays my correct name when I`m on iTunes..PLEASE HELP ME HOW DO I CHANGE THE NAME IN THE DIGITAL CAMERA DRIVE??
    SOLUTION:
    Iam pointing t0 windows7 os.
    1) go to control panel
    2) open hardware and sound
    3) In that open Devices and printers
    4)In that u can find Apple Iphone.
    5) now right click on this --> Hardware --> Properties --> General --> Uninstall --> ok.
    6) now unplug and plug in ur iphone again.There u go u iphone name changes to its original name.

    I am having this problem.  At first with the new iPhone 5, and then with the iPad 2.  I am not sure why this is happening. 
    My gut feeling is this is an iO6 issue and here's why -
    The problem mainly occurs with apps.  I have about 150 apps, and when I plugged in the phone, iTunes went to sync all of them.  The process would hang up after about 20 - 30 apps were loaded onto the phone. I could tell where about the process hung up because the apps on the phone showed up as "waiting".
    Then on the iPad 2 I plugged in to sync and saw there was a huge "Other" component in my storage.  It required me to restore the iPad 2 from backup.  With this restore the same issues occurred - putting the apps back on the iPad would hang up.  The videos on the iPad also got stuck - maybe after about 10 hours of videos transfered iTunes crashed.
    My solution has been to soft reset the device, restart Windows, and continue the process until it's complete.  This is remarkably inefficient and time-intensive but everything works with patience.
    I have been wondering if others have had these same problems. 

  • Please help me with these java puzzle ?

    Dear all,
    My friend send me typical java puzzle about java.util.ArrayList
    which is getting messy. Please help me out. It's not a homework.
    Please help me with these java puzzle ?
    Dear all,
    My friend send me typical java puzzle about java.util.ArrayList
    which is getting messy. Please help me out. It's not a homework.
    import java.util.*;
    public class MyInt ______ ________ {
    public static void main(String[] args) {
    ArrayList<MyInt> list = new ArrayList<MyInt>();
    list.add(new MyInt(2));
    list.add(new MyInt(1));
    Collections.sort(list);
    System.out.println(list);
    private int i;
    public MyInt(int i) { this.i = i; }
    public String toString() { return Integer.toString(i); }
    ________ int ___________ {
    MyInt i2 = (MyInt)o;
    return ________;
    }Hints , fill the underlines with below :
    implements
    extends
    Sortable
    Object
    Comparable
    protected
    public
    i = i2.i
    i
    i2.i=i
    compare(MyInt o, MyInt i2)
    compare(Object o, Object i2)
    sort(Object o) sort(MyInt o)
    compareTo(MyInt o)
    compareTo(Object o)

    Dear all,
    My friend send me typical java puzzle aboutNotwithstanding your pathetic protestations typicial
    of all your posts this is NOT a typical java "puzzle"
    but is indeed a typical homework puzzle.
    And it's damn easy if you spent 30 minutes with a
    tutorial.
    DO YOUR OWN HOMEWORK!
    Hey i did it.
    import java.util.*;
    public class MyInt implements Comparable {
    public static void main(String[] args) {
    ArrayList<MyInt> list = new ArrayList<MyInt>();
    list.add(new MyInt(2));
    list.add(new MyInt(1));
    Collections.sort(list);
    System.out.println(list);
    private int i;
    public MyInt(int i) { this.i = i; }
    public String toString() { return Integer.toString(i); }
    public int compareTo(Object o){
    MyInt i2 = (MyInt)o;
    return i;
    }E:\>javac MyInt.java
    Note: MyInt.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    E:\>java MyInt
    [1, 2]

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • Please help! How can I change the font / text size for the checkout page? I asked Support and they sent me here- thanks in advance for your response.

    Hello everyone! I build an e-commerce shopping cart via BC and integrated it with a muse website as seen at sarahcosmetics .com
    Everything is great, but my clients clients are complaining they cannot see the text well once they're in the checkout page.
    I was able to enlarge the font in my Registration-Buy form in the Online Shop Layouts / Module Templates under the Site Manager. This helped enlarge the font size in the checkout form however my issue arrises on the next page when they have to enter their details like CC information name, address etc. the font is way too small and I'm not sure where to access the tools to enlarge that.
    If you could PLEASE help I would greatly appreciate it. I told my client I would handle it asap and I have no idea how to fix this.
    Thank you in advance for your help.
    Jessica

    This isn't possible yet in the current version of Fennec, but we are working on it. See https://bugzilla.mozilla.org/show_bug.cgi?id=590817 for details.

  • Help me please, I'm new to java

    I created a application called PondVolume.java. I then ran the javac and it compiled correctly (I think) and I had a PondVolume.class file in my directory.
    When I go to execute the program
    java PondVolume 7 4 3
    I get an error "Can't find class PondVolume"
    can someone please help....
    Thanks in advance
    Craig Wiseman
    http://www.videoreaper.com

    Did you try to CD to the directory where PondVolume.class is located?
    I'll assume that PondVolume does NOT contain a package statement. When you enter "java PondVolume 7 4 3" the java.exe command look thru the directories that are in your system's Classpath for a file named PondVolume.class. The directory that contains that file must be in the system Classpath. Try this: CD to the directory that contains PondValue.class and enter "java -classpath . PondVolume 7 4 3"
    If that works, you should edit your autoexec.bat file and add .; to the Classpath setting.

  • Please HELP me with installation - java.lang.noclassdeffounderror:

    Please Help! For school we need to install JAVA. I installed JDK 5.0 and id did not work. I got exception in thread "main" java.lang.noclassdeffounderror: hello. I was using Texpad to write, compile, and run it. In short I deleted all JAVA 5.0 using My Computer program removal. I installed JAVA 1.4..2_10 and I am still getting that same error. I want the JAVA 1.4..2_10 to be installed and not JAVA.5.0.
    My System Variable CLASSPATH still shows C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip. My System Variable PATH has nothing as far as JAVA in it. MY PATHEXT has JS and JSE amoung other things in it. My System Variable QTJAVA still has Files\Java\jre1.5.0_03\lib\ext\QTJava.zip in it.
    Please tell me step-by-step how I can fix this. I never updated these variables before. What do I need to type and where? What do I need to get rid of or change?
    PLEASE HELP!
    Thanks,
    Jim

    I left my System variable classpath --> C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip I left my QT JAVA --> C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip I added Path --> ;C:\j2sdk1.4.2_10\bin and then restarted my computer. I added hello file in C:\j2sdk1.4.2_10\bin and tried to compile it under a new name and it would not compile. it gave me the error below. I was able to compile other java program in my other folder in a different directory. I am still getting the same error messages/ Anything else I should try? IS there anyplace or person I can call who would come and fix this? Something is wrong. This should not be giving me this much trouble. All The Java directions on other websites tell me to do different things. I am so confused... please help.
    I get this during the compilenow:
    javac: invalid flag: C:\j2sdk1.4.2_10\bin\helloa.txt
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -help Print a synopsis of standard options
    Tool completed with exit code 2
    Jim
    If you can fix this I will give you 14 points. I hope it is enough. I just want this to work for school.

  • Can someone please help me with a java assignment

    Hey all,
    I have a favor to ask I have a program that I need for my java class, I have the just of it but I can't figure out the rest, can anybody please help me here is the directions:
    Let's revisit fibonacci numbers, looking at it as a process involving iteration and arrays. Create an array fib[] of 101 elements. Make fib[0] = 0 and fib[1] = 1. Then, in an iterative process going from 2 to 100, compute fib[k]. These numbers get quite large; make it an array of double.
    Then, let the user select a number (such as 7) and have the application display the corresponding finbonacci number (in this case 13). Do this as often as the user wants. If a number larger than 100 is provided, display an error message, but don't terminate the program.
    Here is what I have so far: Please add on and feel free to return to me please, thank you:
    // This is an application that transforms numbers into their Fibonacci number
    import javax.swing.*;
    public class Fibonacci {
         public static void main( String args[] ){
              int k; //simple counter
              int numSize; // how many numbers were entered
              int theNum; // the number entered by the user
              String response; //response of the user
              // define the array
              double fib[] = new double[ 101 ];
              // read in the numbers into an array
              k = 0;
              response = JOptionPane.showInputDialog( "Enter the first number" );
              theNum = Integer.parseInt( response );
              while (theNum > 0){
                   if (theNum > 100)
              k++;
              fib [ 1 ] = 1;
              fib [ 2 ] = 1;
              response = JOptionPane.showInputDialog( "Enter the next number, negative to end" );
              theNum = Integer.parseInt( response );
         } // end while
         numSize = k;
    // terminate
    System.exit( 0 );
    }// end main
    } //end class Fibonacci

    Try this program..Hope it helps
    import javax.swing.*;
    public class Fibonacci
         static double fib[];
         public Fibonacci()
              fib = new double[ 101 ];
              fib[0] = 0;
              fib[1] = 1;
              for(int i = 2; i < fib.length; i++)
                   fib[i] = fib[i -1] + fib[i - 2];
         public static void main( String args[] )
              boolean end = true;
              String response = "";
              int theNum = 0;
              new Fibonacci();
              while(end)
                   response = JOptionPane.showInputDialog( "Enter the number. 999 to end" );
                   try
                        theNum = Integer.parseInt( response );
                        if(theNum == 999)
                             end = false;
                        else if(theNum <101)
                             String Message = "The Fibonacci number at "+ theNum + " is : "+ fib[theNum - 1];
                             JOptionPane.showMessageDialog(null, Message, "Fibonacci Number", JOptionPane.INFORMATION_MESSAGE);
                        else
                             JOptionPane.showMessageDialog(null, "Input should be less than 100", "Error", JOptionPane.ERROR_MESSAGE);
                   catch(NumberFormatException ex)
                        JOptionPane.showMessageDialog(null, "Enter Numeric values", "Error", JOptionPane.ERROR_MESSAGE);
              System.exit(0);
         }// end main
    } //end class FibonacciVish

  • Update - Help - Brand New ipod - won't update with software

    IPod will not update with cd-rom it came with - this is the first - initial - brand new install of ipod
    win xp with sp2 installed
    used cd-rom that came with ipod - followed instructions to the tee - stated it can not update ipod - itunes does not see ipod - went to web site and downloaded 47mb file from june 05
    still will not update - states ipod not supported by this software - the ipod is BRAND NEW - 30gb color photo ipod??
    please help me

    Hi I had the same problem with my last ipod. i tried all of the steps on the apple support site but none of them worked. I decided to send my ipod in for a repair. Anyway when a week later my ipod came back it was fixed but when i loaded up the computer the disk locked again. I followed through the instructions which said to download the newest software. So i downloaded the new software again and this still didnt work. The last thing i tried to do was to use an old version of an updater so i used (ipod updater 2004-11-15) this ran through the restore process and after completing this, the menu on the ipod loaded up. I then connected to itunes and it allowed it to communicate and transfer the songs
    It worked for me i hope it works for you.
    Best of luck
    Daz Semple

  • URGENT PLEASE HELP!!! jsp changes not geeting reflected

    Hello all,
    I am very new to java/jsp.
    I have a jsp file, which was working till I made changes . I made changes to it like changing the title. I complied it, and compiled with no errors. I deployed it in a remote server . cleared the cache of the server and bounced it. When I test it it doesn't reflect my changes.
    please provide some suggestions .. what should i do..
    thanks in advance.

    I understand that it should be able to detect the change and recompile . but still the problem persists... Try using a complete refresh in the browser (ctrl+F5) so that it reloads everything.
    It determines if a JSP needs to be recompiled by looking at the date/time of the jsp.
    Make sure that the time of the JSP is recent, otherwise it doesn't bother to recompile it. Can occur if the server machine and your own machine have different times set.
    What server are you using? What version?
    Where are you putting the JSP file?

  • Brand New to Java and Programming

    I'm brand new, ( RAW ) to software programming at this time. I'm starting from scratch, I work on a Help Desk for the government so I can perform some software functionality but nothing as far as programming.. I would like recommendations for someone starting out brand new.. Books to read (JAVA for Dummies?) any beginner courses? What steps would you take if you were starting out brand new as I am myself.. Thanks..
    PS, I plan on taking courses after I get the beginning stuff out of the way, just don't want to go in with no knowledge base..

    For a nice list of stock answers: The One to Torment Newbies with
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com . A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoritative than this.

Maybe you are looking for

  • Ipod touch will not sync fully with windows 7

    i recently installed windows 7 on my laptop and ever since i have had trouble with my ipod touch. everytime i try to sync it to my itunes library it starts to sync and then my ipod dissapars from itunes, as if it's not even connected anymore, then it

  • Some Finder Sounds Aren't Working (Trash File and Move File)?

    Last night I noticed that *some of the finder sounds* aren't working (trashing and moving a file/folder) on my mac mini. The rest of the finder sounds seem unaffected (emptying the trash, removing an icon from the dock). I tried some solutions online

  • Printing in Web Based PDF

    I have a strange problem with the printer and hope someone can help. HP Printer Deskjet All In One F4440 Windows 7 64 Bit With my job, I have to print a lot stuff where the pdf is already embedded in the site. When I go to Print/Properties (from insi

  • Oracle 10gR2 Automated Storage Management implementation on CentOS 4.1

    Actually there are several nice articles on Oracle Technical Network devoted to the same topic. What’s new may be said ? The target of this message is to highlight the optimal sequence of steps required to bring Oracle10g (10.2.0.1) ASM-database up o

  • How do i make a water mark or signiture

    How do I make watermark or signeture