Line Problems in Linux ...

Hi
i write a simple program, which only draws a few Lines in a JFrame. It works fine in Windows. But it makes problems on my Linux (Ubuntu) OS, allthough the java versions are the same on both systems.
"Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0._05-b05) ... "
If i start the programm in linux, the lines will be shown only for a few milliseconds. (or sometimes so fast, that i can't see it ) and after that the Frame is blank ( simple problem with "public void paint ( graphics g ), i think"
i don't know if i'm in the right forum, my first thought was, it's maybe a bug in the jre.
But i think my codestyle is rather a bit dirty with the 2D Graphics and the windows java machine is maybe more tolerant than my linux machine.
http://www.inravage.net/M.java
here you can see the current source-code ( it's not very much )
So if you have a good idea, why it doesn't works under Linux, i'll be very grateful.

Did you find the problem? I got the same problem (i know the cose is not as good as it could be, cause i take a old code part from a older project, but it work #1 on windows).
thx a lot

Similar Messages

  • Unicode filename problems in linux

    I'm running into a problem in linux (Ubuntu). The following test code will throw an exception at the "FileInputStream fis... " line with the file has a unicode filename. However, Windows passes this without problems.
    try {
         File dir = new File("a directory that exists");
         File[] files = dir.listFiles(); //get file list
         for (int i = 0; i < files.length; ++i) {
              System.out.println("file " + files.getAbsolutePath());
              FileInputStream fis = new FileInputStream(files[i]);
    } catch (Exception e) {
         System.out.println("Exception: " + e.getMessage());
    Does anyone know how to fix this? Thanks!

    But the characters are actually chinese. And since
    it's on Ubuntu, it would be in UTF-8 encoding
    wouldn't it?
    The characters display fine in ubuntu but when I try
    to read them in using FileInputStream, it fails for
    some filenames with strange characters.
    I just don't understand why some characters make it
    fail and others are fine. It seems that it should
    all work or all not work? Perhaps I'm wrong.On my Fedora Core 6,
    the result of
    echo $LANG
    is:
    ja_JP.UTF-8
    And I tried your program on a directory that has &#30334;&#24230;MP3��&#20840;.txt file in it.
    import java.io.*;
    public class AlsKdj{
      public static void main(String[] args){
        try {
          File dir = new File(".");
          File[] files = dir.listFiles();
          for (int i = 0; i < files.length; ++i) {
            System.out.println("file " + files.getAbsolutePath());
    FileInputStream fis = new FileInputStream(files[i]);
    System.out.println(" " + fis.toString());
    catch (Exception e) {
    e.printStackTrace();
    The output from the program is:
    file /root/test/./AlsKdj.class
      java.io.FileInputStream@1a46e30
    file /root/test/./&#30334;&#24230;MP3��&#20840;.txt
      java.io.FileInputStream@3e25a5
    file /root/test/./bbs.txt
      java.io.FileInputStream@19821f
    file /root/test/./WMP.txt
      java.io.FileInputStream@addbf1As shown above, the result is normal if LANG is really UTF-8.
    My Java version is:
    java version "1.6.0_01"
    Java(TM) SE Runtime Environment (build 1.6.0_01-b06)
    Java HotSpot(TM) Client VM (build 1.6.0_01-b06, mixed mode, sharing)

  • Path problem in linux

    hi,
    i have problem with file path accessing in linux. my java class is accessing a abc.cvs file and and getting all data. it is working fine in windows xp. but i run this same file in linux it does not access the abc.cvs file and does not get any data.
    my project structure
    Search
    abc.cvs
    search.SearchMain
    i am sccessing this cvs file in this SearchMain class by this way file name = "abc.cvs"
    It is working fine with window but problem with linux.
    when i place this abc.cvs in a folder as "./data/abc.cvs" also working fine with windows but not in linux.
    I am new for linux.
    Please give me solution.
    Thanks in advance
    Ravi

    There shouldn't be any differences between Linux and Windows here, it's all about your environment. In order to access abc.cvs class (I presume that abc is package name) from search.SearchMain class you need to have a directory (or .jar file) containing abc/cvs.class in your CLASSPATH environment variable.
    Try setting it with
    export CLASSPATH=your_dir_or_jar_file:$CLASSPATH
    and then running the app again.

  • File problem in linux OS.

    hi,
    I am creating one jar file . In my program, when I click one survey menu in my GUI,it will collect information from remote device and store it in log file located LOG folder. In my case, I put one folder " Cal" and inside it I put myjar.jar file and that log (LOG) folder.
    In Windows, when I click survey menu in GUI, the log information automatically stored in log foder as survey.txt file. And also, i create one show dialog box to show where the log file located.
    my code is,
    String  ss=new String(" HIllo"+"loginfo" );           
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream               ("LOG/survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    the above code is file writing in txt file.
    for display dialog box,
    if(source==Survey)
                    File file = new File("LOG/Survey.log");                      
                    file = file.getAbsoluteFile(); 
                    javax.swing.JOptionPane.showMessageDialog(MainFrame, "The LOG FILE is stored at -- \t \t"+file);
                 }In windows, where can i install that Cal folder (inside it JAR file and LOG folder), and click that jar , all are working fine. The log file stored correctly inLOG folder and dialog box show the located path.
    eg. log file stored at D:/sbk/Cal/LOG/survey.log
    But my problem in linux.
    when i click survey menu, it will defaultly stored in root folder and log folder. Actually i am not creating LOG folder in root folder.
    I am changing file writer as , to store that JAR folder and want to store that log file in home directory.
    if(no_of_ssid!=null){
                    String  ss=new String(""HIllo"+"loginfo\n" );          May
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream ("/home/Cal/LOG/Survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    but, now also that file stored in rot directory.
    what can I do.
    how can I store log file in home/Cal/Log folder in Linux.
    any one help this problem

    Use System get prop user.home?

  • Intermittent noisy line problem

    Hi.  Just about tearing my hair out over a line problem which has been giving trouble on & off for over 6 months.  The line becomes very noisy from time to time, depending on weather it seems.  We have had similar problems ever since moving here 13 years ago - the line runs overhead through woodland for about 4km to the exchange - and each time it is a corroded wire due to water penetration somewhere along the route.
    This time the engineer cannot locate the fault.  He agreed there was noise but the equipment he had could not locate where it was.  He advised calling another engineer when it was bad and hopefully he would be able to locate it.  However, I have just noticed that BT has charged me £127 for the visit, even though there was no suggestion that the fault lay with the internal wiring or equipment - heck, I even gave the guy a cuppa tea!
    Any advice on (a) getting the charge reversed and (b) getting the fault sorted.  Sometimes the line is so bad I have to resort to mobile, and the broadband speed can drop to a few hundred kbps.  Grrrrrr.
    Solved!
    Go to Solution.

    Try contacting the board mods
    At [email protected] with a link to this post and your bt account no and phone no they will reply within a few days and are great at sorting these sort of problems
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • HEAVY Problems with Linux x86_64 on K8T Neo

    Hello, Community!
    I experience *HEAVY* Problems with Linux on my MSI K8T Neo (FSR). Since the customer support of the german dependancy seems to ignore my call for help I'm in good hope that maybe you can help me out or give me some useful advise.
    First some Hardware Specs of my system:
    MSI K8T Neo FSR, Rev 1.1, BIOS 1.5
    AMD Athlon 64 3000+
    3x 512MB Kingston DDR400
    Enermax EG365P-VE (350W) PSU (3.3V/5V 185W Combinded)
    MSI GeForce FX5200 TDR 128
    Adaptec ATA RAID AAR1200A (HPT370A) in PCI Slot 3
    Hauppauge WinTV PCI in PCI Slot 5
    Maxtor 4K040H2 (40GB) as Primary Master
    JLMS XJ-HD166S DVD-ROM as Primary Slave
    LiteOn LDW-411S DVD+/-RW as Secondary Master
    LiteOn LTR-52327S CD-RW as Secondary Slave
    2x Maxtor 6Y060L0 (60GB) on HPT370A as Primary Master/Slave
    Seagate ST380020A (80GB) on HPT370A as Secondary Master
    Maxtor 32049U3 on HPT370A as Secondary Slave
    KeyTronic KT2001 USB Keyboard
    Microsoft Optical Wheel Mouse Blue USB
    I've downloaded Fedora Core 1 x86_64 as well as the lately released Fedora Core 2 test 3 x86_64 distribution. Both CD sets have been burnt ok.
    If I try to install Core 1 x86_64 (Kernel 2.4.22-1.2179) the kernel crashes with a "attempted to kill idle task" panic. As far as I've learned the workaround is to give idle=poll as kernel parameter. This resolves the kernel panic, but the installer randomly crashes with segfaults at a random stage; sometimes while loading anaconda, sometimes during package install.
    If I try to install Core2 test 3 x86_64 (Kernel 2.6.5) I get a, completely new, error message while the kernel does the PCI Scan:
    ******* Your BIOS seems to not contain a fix for K8 errata #93
    ******* Working around it, but it may cause SEGVs or burn power
    ******* Please consider a BIOS update
    ******* Disabling USB legacy in the BIOS may also help
    I removed my USB keyboard, connected a PS/2 keyboard, disabled to USB Legacy option (I need it enabled in order to use Ghost) in the BIOS and booted again.
    The error message is gone now, but as in Core 1 the installer still crashes randomly with segfaults. I'm still unable to go all the way through the installation routine.
    I even tried to install Fedora Core 1 "i386": again there are segfaults during install.
    Contrary to the problems I experience while trying to install Linux my Windows XP (32-Bit), as well as a test installation of Windows XP 64-Bit, run like a charm without any problems. Strange but true.
    Since I already read trough several posts in this forum I already tried running my system with memory sticks from another manufacturers as well as with a more powerful PSU. I even removed my tv-card and raid-controller.
    Nogo - Linux still crashes randomly and Windows still works without any flaws.
    Has anyone a clue what I can/must do to successfully install Linux?
    Might it be that the BIOS has some flaws that might cause the problems?
    Has anyone managed to install Linux (what distribution) on this Mainboard?
    I would greatly appreciate any help. If you need to know something I haven't provided here please feel free to ask. I'll answer ASAP.
    Thank you in advance.
    P.S.: The system is *NOT* overclocked in any way.

    And now even the last problem is solved ...
    Since I was successful in installing a basic Gentoo system but still failed to install Fedora I reflashed BIOS 1.5. This time I cleared the CMOS by unplugging the PSU, setting the jumper and removing the backup battery.
    Yesterday I only flashed it with the /a switch, which should have cleared the CMOS as well - so far for the theory. However, it once went fine as I upgraded from BIOS 1.1 to 1.4.
    After setting up the BIOS options again I gave it another try and booted from Fedora (Core 2 test 3) install CD: No more complains about the CPU errata, although USB legacy is enabled, and I even went through the installation without any problems.
    It seems as I will stick with Gentoo as my primary distribution since the kernel makes a more "mature" impression than the one from Fedora (i.e. the K8 PowerNOW! Driver seems to be missing in Fedora's Kernel 2.6.5).
    By using an spare Athlon XP Mainboard I worked out that only one of my three Kingston memory sticks had errors - I'm going to replace the faulty stick tomorrow.
    Now for the conclusio:
    Thanks, especially you JLP, for helping me with my issue. Without the advise to use Gentoo, and the included MemTest86, I wouldn't have been able to track down the error to a faulty memory stick that fast since Windows always ran fine.

  • Using Command Line Tool for Linux

    I have to use the command lines of Linux for SCM commands(like repcmd, set workarea, checkin etc...)
    should I have to install something?
    I have documentation for using the oracle repository command line Toll for Windows and Unix, but I didn't found anything about using the oracle repository command line Toll for Linux.

    JDeveloper runs excellent on Linux and is supposed to be able to use the repository, but that's a GUI...

  • I faced white screen with gray line problem on startup. How to fix it?

    I faced white screen with gray line problem on startup. How to fix it?

    Hi vikashjha,
    Thanks for visiting Apple Support Communities.
    You may find some of the troubleshooting steps in this article helpful:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/HT1573
    Cheers,
    Jeremy

  • Counting lines problem. Please help!!

    Hi all,
    I just have a small problem i cannot resolve, here it is: I read through a file and i like to count the lines of the file there is before a special word.
    E.g
    My file contains:
    "hi
    how are you
    my name is john
    and i live
    britain"
    I'd like to count how much lines there are in the file before the word LIVE ==> result would be 4.
    I proceed with StreamTokenizer, but i don't knor how to specify the word. Here is my code:
         try {FileReader fr = new FileReader("test2.dat");
                   BufferedReader br = new BufferedReader(fr);
                   StreamTokenizer stk = new StreamTokenizer(br);
                   do {
                   n = stk.nextToken();
                   li = stk.lineno();
                   if (n == stk.TT_NUMBER) {
                        n = stk.nextToken();
                   if (n == stk.TT_EOL) {
                        li++;
                        n = stk.nextToken();
                   if (n == stk.TT_WORD) {
                        String str = stk.sval;
                        if ("entier".equals(str)) {
                             System.out.println(li);
                        else {
                             n = stk.nextToken();
                   while (??????????????);
    I want here to specify the word "entier" but how to do this??
    Thanks very much for your precious help....

A: Counting lines problem. Please help!!

Use LineNumberReader, which counts lines for you. Here's a complete program in 16 lines:
import java.io.*;
public class test4 {
  public static void main(String[] argv) {
    if (argv.length < 2) { System.err.println("no arg"); System.exit(0); }
    try {
      LineNumberReader in = new LineNumberReader(new FileReader(argv[1]));
      String line;
      while((line = in.readLine()) != null)
        if (line.indexOf(argv[0]) != -1)
          System.out.println("Found match at line " + in.getLineNumber());
    } catch (IOException e) {
      e.printStackTrace();
}If you want case insensitivity, you can make both lines lower-case before searching. Or you can use regular expressions.

Use LineNumberReader, which counts lines for you. Here's a complete program in 16 lines:
import java.io.*;
public class test4 {
  public static void main(String[] argv) {
    if (argv.length < 2) { System.err.println("no arg"); System.exit(0); }
    try {
      LineNumberReader in = new LineNumberReader(new FileReader(argv[1]));
      String line;
      while((line = in.readLine()) != null)
        if (line.indexOf(argv[0]) != -1)
          System.out.println("Found match at line " + in.getLineNumber());
    } catch (IOException e) {
      e.printStackTrace();
}If you want case insensitivity, you can make both lines lower-case before searching. Or you can use regular expressions.

  • Blue Shapes Occuring Randomly(Not Line Problem)

    Blue Shapes Occuring Randomly(Not Line Problem)
    I have just purchased my powerbook 1.67 1440*960. I started to see blue shapes around the windows that I move and around many things that move on the sceen after the first week of my purchase. At first I thought this was a configuration problem but it seems more like an hardware problem although the hardware test found all the devices successfull.
    In addition, when I installed call of duty, the blue shapes occur very fast and randomly everywhere on the screen making it impossible to play the game.
    You could have a look at the picture to see how disturbing they are.
    http://homepage.mac.com/altan.sursal/FileSharing1.html
    Does anybody have an idea why such blue shapes occur?
    Thanks All

    Most likely one of the reasons your not getting any answers is that you need to post a link to the page.  Sifting through all that code without the ability to see the actual page makes the going slow.
    Post a link to the page and I'm sure help will be on the way.
    Gary

  • I want a free upgrade to Intel To fix the line problem

    i have the line problem and the new intel MacBook has (i think) a bigger screen but less pizels than the old one so i guessing it will not have the line problem and i want a free upgrade.
    do you think apple will do it?

    Update: After 2 hours on the freeking on with apple care... i got nothing, every person i talked to acted like they have never even heard of the line problem. So yeah there was no way of me getting a MacBook.
    They did say i could send my PB in to see if i could get the screen fixed. I really dont want to because i cant live a long long time with out my powerbook and then get it back weeks later and NOTHING fixed.
    BTW - it was a little funny with every one using the term MacBook, They would mess it up and stuff and even when one of the person was talking about it i was thinking "Mac Book" as in a book the people look in to look up specs and problems and stuff.
    Also one person said they have allready sold over 100,000 and im like "wow they only went on sale a few hours ago and its not shipping for another month.

  • Hp a1230n reboots and vertical lines problem

    Hi
    I'm completely new so this may even be in the wrong place but yeah basically what it says in the title. It keeps rebooting on its own. Sometimes the screen will only show vertical lines that are the same color as what was on the screen. I've scanned it for viruses with first Macfee and then Avast and they've said its clear, and it runs fine other than the rebooting and lines problem.
    Thank You

    Hello mnstrzero00,
    You’re having problem with the computer rebooting.
    Your problem could be software problem of hardware.
    How long has this problem been happening?
    If it has not been happening for very long you might just try a system restore back to before the problem started. This should correct the problem without affecting any of your files.
    Here is a link to do a restore.
    Before the restore run the following command in command prompt.   SFC /scannow.
    Click start -> click run -> type CMD -> hit enter.
    This will check system files and correct them if it can.
    Also to make sure that it is not hardware.
    Turn off the computer and the n turn back on, at startup tap the F2 and run hardware diagnostics.
    Let me know if this helps.

  • Satellite 3000 screen vertical line problem

    my laptop is Satellite 3000 , it got vertical line problem now, i wanna use a outside CRT screen to replace the current damaged LED screen.
    I have tried to use FN-F5 swap key, but it is still doesn't work, i tried to log in the system to check it, (the system (windows xp) is normal), but i can't see anything because the screen is black, it won't get in the system even if i connected it in to the LAN, because the laptop network function configuration is not allow connect with internet,( i did ghost before it completely damaged), the question is :
    1, do i need to configure something so as to it can use outside screen in windows XP system? or just use FN-F5 swap key?
    2, how will i do next step if i wanna use the outside screen ?
    thx a lot

    Hello
    If the notebook is preinstalled with all Toshiba designed tools and utilities FN+F5 key combination should work. Of course the external monitor should be connected properly.
    If you are missing some tools FN+F5 key combination will not work.
    What I want to know is what happens exactly when you use FN+F5 key combination? Stays the LCD screen black or switch to the right picture again? As far as I know if you use FN+F5 key combination and LCD on the notebook stays black that means the signal is send to external device but if the monitor is not connected properly or there is some contact problem you will not see the content on external monitor.
    Believe me it is not easy to say what is wrong there but if possible try to test it with different monitors. Satellite 3000 is pretty old notebook model and maybe is RGB port defective.

  • Using the Oracle Repository Command Line Tool under Linux

    I have to use the command lines of Linux for SCM commands(like repcmd,
    set workarea, checkin etc...)
    should I have to install something?
    I have documentation for using the oracle repository command line Toll
    for Windows and Unix, but I didn't found anything about using the oracle
    repository command line Tool for Linux.

    JDeveloper runs excellent on Linux and is supposed to be able to use the repository, but that's a GUI...

  • MBP Display Lines Problem

    Hey everyone, I just bought a MBP 15' 2.2Ghz last wednesday and am now seeing a display line problem. I see a green dotted line that extends from the top of the screen to the bottom approximately 2 inches from the right of the screen. The color of the line seems to change slightly depending on whats on the screen. For instance, I had the ladybug wallpaper and the line was almost complete all the way down (stil dotted with a missing section) and the color was bright green. With a different wallpaper that had a night sky and a green figure, the line flickered green/blue in the night sky area and steady green in the green part. My question is whether this is software or hardware related. I read many many other posts and many had display line problems but not the same as this one. Should I get this repaired? Is there anything I can do to fix this? Thanks

    Hey man, sorry to heard you have a display problem too. I have a line at the bottom of my display which extends across horizontally. Fortunately, its just a clear, bleached looking line which I can mask with the dock. I dont think I could tolerate the line in which you have described.
    I would bring it to the apple store that you bought it from and have one of the apple guys check it out. I would demand a replacement. They will try to repair it. You shouldnt be repairing a defective purchase.
    I am on my 2nd MBP. My first was kernal panicing all the time. I got it to KP in the store and he immediately offered a replacement. Apple care is pretty good, so dont be afraid to bring it in and demand a replacement.
    Better luck with your next one!

  • Maybe you are looking for