Different stringWidth between Linux and Windows

When I use Ms Windows Arial Font in my Java Program running on Linux
I found out the rendering result of the Font is different with same program running on Windows
The Arial Font in Linux become wider, and this cause problem because i used absoule position.
I am using Java 1.3.1, How can solve this problem??

The Arial under Linux and Windows are not the same. Firts, they may be different font files, second, both systems uses different rendering engines to draw them. Also, some systems, as mine, won't have Arial font at all - substitute font will be used then. So, I would expect, you will have similar problems with any other font, any other operating system or even in some specific locales which uses reversed (right-to-left) line ordering. You will also be not able to do internationalization properly.
Simply your application is not portable and written with breaking may portability rules. I hope, you are not doing it for money. The layout managers is the only existing aswer to your problem. The closest to absolute is a SpringLayout introduced in 1.4.x.
The absolute location problem is not a bad thing in Java only - it can screw C, VisualC and CBuilder applications. Take some of them and tweek your system settings - use large fonts for buttons, tiny fonts for menu, change whatever OS provides you to be able to change in L&F and look what will happen with some of those applications. I would be really happy to have layout managers in CBuilder.
regards,
Tomasz Sztejka.

Similar Messages

  • Problems using RMI between linux and windows.

    I have problems using RMI between linux and windows.
    This is my scenario:
    - Server running on linux pc
    - Clients running on linux and windows PCs
    When a linux client disconnect, first time that server try to call a method of this client, a rmi.ConnectException is generated so server can catch it, mark the client as disconnected and won't communicate with it anymore.
    When a windows client (tested on XP and Vista) disconnect, no exceptions are generated (I tryed to catch all the rmi exception), so server cannot know that client is disconnected and hangs trying to communicate with the windows client.
    Any ideas?
    Thanks in advance.
    cambieri

    Thanks for your reply.
    Yes, we are implementing a sort of callback using Publisher (remote Observable) and Subscribers (remote Observer). The pattern and relative code is very well described at this link: http://www2.sys-con.com/ITSG/virtualcd/java/archives/0210/schwell/index.html (look at the notifySubscribers(Object pub, Object code) function).
    Everything works great, the only problem is this: when a Publisher that reside on a Linux server try to notify something to a "dead" Subscriber that reside on a Windows PC it does't receive the usual ConnectException and so tends to hang.
    As a workaround we have solved now starting a new Thread for each update (notification), so only that Thread is blocked (until the timeout i guess) and not the entire "notifySubscribers" function (that contact all the Subscribers).
    Beside this, using the Thread seem to give us better performance.
    Is that missed ConnectException a bug? Or we are just making some mistake?
    We are using java 6 and when both client and server are Linux or Windows the ConnectException always happen and we don't have any problem.
    I hope that now this information are enough.
    Thanks again and greetings.
    O.C.

  • Connect as sysdba between Linux and Windows without using password

    hello
    Hello
    I need to connect as sysdba between Linux and Windows without using password for the sys user
    Sqlplus /@string_connection
    Plz help me

    Duplicate post:
    Connect as sysdba between Windows and Linux
    Actually you have been given the answer in your above thread. You need to read the Oracle documentation. Search password file at tahiti.oracle.com
    regards

  • Applet font problem between linux and windows

    I just want to share my experience in several project i've taken part.
    In some projects, where all are developed under linux environment (suse 9.2),
    we use jasper report for report generation and use the web applet for our clients to print.
    They print ok in linux env, with the netscape 7.1, courier 10 font and jvm 1.4.2_06b version.
    But when accessed from windows env, with the same browser and the same jvm version, the applet and the print out are different from those of lin env. The headers and footers are missing. When the we edit/lower the header and footer size at the jasper report file, then they appears @ the window env.
    So strange that the font handling between win and lin differ (still my assumption). I'vent been able to solve this problem totally since the client must stick with one OS else the print out will be different.
    Quite dissatisfied, coz i really think i could code once the report and run it anywhere in the applet and behaves in the same way.
    Could anybody help ? T-T
    Regards,
    Albert Gan

    hi!
    this is my first post and i would like to ask if how did you create the web applet printing. im totally new to java and i dont know where to start.
    i hope that you can guide me or give me some instructions. thanks in advance =)

  • Oracle weirdness between Linux and Windows........Any ideas??

    Hi,
    I'm connecting to the same database which is on a linux server.....
    This is the weirdness I'm getting...
    ---Connecting via SQLDeveloper in Linux (ubuntu), I'm running the following:
    desc message_instance_attr
    Name                           Null     Type                                                                                                                                                                                         
    INSTANCE_NO                    NOT NULL NUMBER(10)                                                                                                                                                                                   
    A_NAME                              NOT NULL VARCHAR2(32 CHAR)                                                                                                                                                                            
    A_VALUE                            VARCHAR2(1024 CHAR)                                                                                                                                                                          
    OWNER                              NOT NULL VARCHAR2(3 CHAR)                                                                                                                                                                             
    LAST_UPDATED_DATE       DATE                                                                                                                                                                                         
    UPDATE_COUNT                NOT NULL NUMBER(8)                                                                                                                                                                                    
    6 rows selected----Connecting via SQL plus to the same database in Windows:
    SQL> desc message_instance_attr
    Name                                      Null?    Type
    INSTANCE_NO                               NOT NULL NUMBER(10)
    A_NAME                                        NOT NULL VARCHAR2(128)
    A_VALUE                                      VARCHAR2(4000)
    OWNER                                        NOT NULL VARCHAR2(12)
    LAST_UPDATED_DATE                 DATE
    UPDATE_COUNT                          NOT NULL NUMBER(8).
    Why is the Datatype limit different between the two even thoughI'm connected to the same database? for example why is A_VALUE on Linux VarChar2 (1024) and in Windows VarChar2 (4000)
    Thanks!

    Check this link -
    http://download.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm
    DESC is not standard SQL. It is SQL*Plus specific.
    Many tools may allow desc commands to describe the table structure - but not sure whether they act the same way.
    Why don't you use DESC from SQL*Plus from both windows & linux and let us know the output?
    Regards.
    Satyaki De.

  • VPN -- different behavior between Mac and Windows XP clients.

    Hi,
    Background:
    I have a Mini server serving L2TP IPSEC vpn with both Mac and Windows (all XP, so far) clients.
    The mini sits behind a Netopia router/firewall/NAT box that port forwards L2TP traffic to the mini.
    The mini has a public but unrouted address (unrouted in the public Internet, that is.) The same Netopia serves as the router for outgoing public connections. DNS is served by other servers.
    The VPN clients are distributed addresses from the unrouted public address space.
    Client <-> NAT <-> Public Cloud <-> NAT <-> Private (with public addresses) <-> Mini (VPN)
    Mac clients work happily, accessing internal and external hosts.
    The XP clients have a registry value set to allow NAT traversal:
    under HKEYLOCALMACHINE\SYSTEM\CurrentControlSet\Services\IPSec, AssumeUDPEncapsulationContextOnSendRule is set to 2 to allow dual Nat traversal.
    The XP clients happily access internal hosts, but hang accessing some, but not all external hosts.
    For example, most Google services are quickly displayed, whereas www.comcast.net or www.llbean.net hang. It appears to be more frequent accessing third-party hosts while processing the initial page. Some Google web services, e.g. some Google Map plugins do eventually hang.
    An XP host internal to the network configured with the above registry key set to 0 (No NAT traversal)
    exhibits the same behavior when using a VPN connection
    Public Cloud <-> NAT <-> Private (with public addresses) <-> Mini (VPN) <-> Pvt. <-> Client
    Same host without VPN works fine.
    Clearing the XP checkbox that routes all traffic to the remote (VPN) router makes external hosts work
    as you would expect.
    So my questions are:
    a) What's XP doing?
    b) Can it be fixed? (besides routing public traffic away from the VPN.)
    Thanks Jonathan
    p.s. MrHoffman, I almost asked this in the HP Forum as well, till I noticed you were here. (Assuming you are Hoff.)

    Hi soccerdude21490-
    +Is this possible?+
    Theoretically yes. However, it would be up to the school to allow you access through their network.
    The first step would be to contact the school's IT department and ask them if they will allow such a connection, and if so, could they please provide you with the settings (ip address etc.).
    Luck-
    -DP

  • Differing behavior loading external swfs between Linux and Windows

    I have a swf that loads several different swfs that implement the same basic class, some of these external
    swfs also import different resources from library swfs, such as font, video, and graphic assets.
    This seems to work perfectly well on both windows and Linux with using the font and graphic assets in
    the flash player (debug v 10r32), everything works as I'd expect.  I am added everything into the main swf's
    appdomain when using the loader (with loadercontext, etc).
    When I am loading the video asset class in the external swfs, it works fine on both systems for the first swf
    loaded that uses the video class.  On windows, whenever the second swf using the video library loads up, it
    gives a #1065 Reference error pointing to one of the variables used in the video asset swf.  It runs fine on Linux.
    I've tried playing around with the different AppDomain settings to no avail.  I am stumped as to why it would
    function perfectly well in Linux, but fail on Windows.  Any pointers as to where to look next?
    Thanks for any and all help,
    RP.

    In this case, it appears to be differing versions of the flexsdk that was being used to compile the application.
    Windows was using the default tarball from the adobe site,
    Linux was using a more up to date version from svn.
    I updated the svn snapshot, recompiled, set the Windows box to use it, and the error messages have disappeared.
    I can still crash the flashplayer doing other things, but it's more or less working exactly as expected now.
    RP.

  • Font differs from Linux and Windows ?

    Hi, i just want to ask, are fonts different from windows and linux in applet. I use a standard courier font.
    For example, if i make an applet with courier font texts in linux, and make the texts wrap themselves, they will run ok in linux. But if i run the compiled applet in windows, the wrapped text somewhow got truncated.
    But if i compile the applet in windows, it will look ok in linux and windows.
    I've tried replacing my courier fonts in my /usr/java/jdk/jre/lib/fonts/cour*.ttf with the cour*.ttf from c:\windows\fonts with no effects .. Applets compiled and run ok in linux doesnt work in windows. They must be compiled in windows to run ok in both.
    Why is that ?
    Does the compilation use the fonts in the jdk lib or the system fonts ?
    I'm so confused T_T
    Please Help

    How do I get Mac OS 10.4.4 and Word X for Mac to see
    all the characters in the Word for PC document
    formatted in Times New Roman?
    There's no way with Office X, which can't do Unicode Greek. You need to upgrade to Office 2004 which is Unicode-savvy and installs in your Mac the same Times New Roman with Greek, Cyrillic, Hebrew, and Arabic which is used by WinXP. An alternative might be AbiWord or NeoOffice/J.

  • CD different for Linux and Windows

    I have in hand a very strange CD. This is an (old) CD with drivers for a Samsung printer. The CD has drivers for Linux and Windows. But if I mount the CD in Linux, I see only the Linux driver and if I access the CD from Windows, only the Windows drivers are seen. How they can do that ? How can I mount in Linux the CD in order to see the content seen from Windows ?

    In Windows ( DIR D: )
    Le volume dans le lecteur D s'appelle SAMSUNG_LBP
    Le numéro de série du volume est C432-A954
    Répertoire de D:\
    28/02/2005 00:53 <REP> ACROBAT_READER
    26/10/2004 06:11 740 AUTORUN.INF
    28/02/2005 00:53 <REP> DATA
    28/02/2005 00:53 <REP> ML-1610
    28/02/2005 00:53 <REP> Manual
    09/12/2004 03:55 11 219 SETUP.DAT
    20/09/2004 07:29 270 336 SSAuto.Dll
    17/09/2004 08:03 253 952 SSEtc.dll
    22/09/2004 11:09 225 280 SSFcs.dll
    12/03/2004 05:59 1 622 016 SSRes.dll
    17/09/2004 08:04 155 648 SSTtp.dll
    26/10/2004 05:42 307 200 Setup.exe
    28/02/2005 00:54 <REP> USB
    8 fichier(s) 2 846 391 octets
    5 Rép(s) 0 octets libres
    In linux (ls -l -F /mnt/cdrom)
    total 44
    dr-xr-xr-x 22 root root 4096 Feb 28 2005 Manual/
    -r--r--r-- 1 root root 2555 Feb 28 2005 README.txt
    -r-xr-xr-x 1 root root 51 Feb 28 2005 autorun*
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 bin/
    dr-xr-xr-x 8 root root 2048 Feb 28 2005 cups/
    dr-xr-xr-x 4 root root 2048 Feb 28 2005 data/
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 help/
    -r--r--r-- 1 root root 8517 Feb 28 2005 icon.xpm
    dr-xr-xr-x 9 root root 2048 Feb 28 2005 locale/
    dr-xr-xr-x 2 root root 6144 Feb 28 2005 misc/
    dr-xr-xr-x 3 root root 2048 Feb 28 2005 ppd/
    dr-xr-xr-x 2 root root 2048 Feb 28 2005 scripts/
    dr-xr-xr-x 4 root root 2048 Feb 28 2005 setup.data/
    -r-xr-xr-x 1 root root 6603 Feb 28 2005 setup.sh*
    ouput of isoinfo -d dev=dev/sr0 (in linux)
    CD-ROM is in ISO 9660 format
    System id: LINUX
    Volume id: SAMSUNG_LBP
    Volume set id:
    Publisher id:
    Data preparer id:
    Application id: MKISOFS ISO 9660/HFS FILESYSTEM BUILDER & CDRECORD CD-R/DVD CREATOR (C) 1993 E.YOUNGDALE (C) 1997 J.PEARSON/J.SCHILLING
    Copyright File id:
    Abstract File id:
    Bibliographic File id:
    Volume set size is: 1
    Volume set sequence number is: 1
    Logical block size is: 2048
    Volume size is: 239152
    Joliet with UCS level 3 found.
    SUSP signatures version 1 found
    Rock Ridge signatures version 1 found
    Rock Ridge id 'RRIP_1991A'
    If I use on Windows the Windows port of cdrtools; then these tools behave as in Linux, showing me the Linux contents. In Linux I can also mount -t udf and then I see:
    total 32
    -rw-r--r-- 1 root root 32768 Feb 28 2005 Desktop DB
    -rw-r--r-- 1 root root 0 Feb 28 2005 Desktop DF
    drwxr-xr-x 1 root root 22 Feb 28 2005 Manual/
    This was for a Samsung ML-1610 B/W laser printer. This is crazy.
    @lolilolicon That explain the result when I mount -t hfs. But the difference in Linux and Windows remain mysterious. How Windows "mount" the CD? I believed it was the equivalent of mount -t iso9660 in Linux but apparently, it is not.
    Last edited by olive (2011-09-08 12:12:16)

  • How to set owner-only access file permissions both on Linux and Windows

    Hi everybody.
    I have the following problem. I need to store some private user information in file system. So I need to set owner-only access permissions for some directory in user home. I did not find API for doing this. As I understand this is platform specific thing. Could anybody tell me how can I do this both on Linux and Windows?
    Thank you in advance.

    More ideas just came back to me (of something I did before)
    Each OS requires a different control.
    For Windows you will need to set the .policy file for each user (a pain if you have more than a dozen of clients) granting access (R or RW) to files/directories.
    Then you have to write some native code (access via JNI) to access/modify your authorization.
    A more professional solution that I used was J-Integra (other similar tool exist).
    Basically it is a bridge between Java and COM. It magically give you access to the COM API from Java (and vice versa).
    In my case it was to read/write/modify Winword documents transfered between PC and server.
    From memory you have to run the com2java.exe to build the bridge (classes in Java language) between the 2 families. Compile those classes and you have a "driver" for the COM (Microsoft Objects).
    Here I must confess my ignorance on Microsoft.
    Those COM objets must give you some easy/integrated access to the API for LDAP or Microsoft Active Directory Service (for centralize control with more complex setup).

  • Reset() of ObjectOutputStream diff in Linux and Windows

    From the previous post and my test, it is better to call ObjectOutputStream oos.reset() to clean up buffer.
    But I notice that it works all fine in Linux, but if the remote site is a Windows machine, if you call oos.reset(), the remote site will throw socket.reset Exception and close the socket, which is not good at all.
    So I have to disable oos.reset() call to avoid remote java socket in Windows close, but I get OutOfTheMemory error after running a while, I suspect it is caused by not calling reset() and clean up buffer. So what should I do to avoid this problem?
    Thanks

    It sounds like you are running different versions or a buggy of the JDK.
    What versions are you using?
    This works fine with 1.4.2_05 (between Solaris and Windows)

  • Oracle DB sessions on Linux and Windows

    Actually I am confused the way session memory is allocated on 32 bit windows and linux OS.
    Windows is a thread based architecture where all user sessions are treated as threads of oracle.exe process. The addressable space is 4GB and oracle.exe can use up to 3GB in case you use /3GB switch in boot.ini file. It means that combined size of SGA ,PGA and other memory structures can not be more than 3GB. When a session gets connected with a database a PGA is allocated. It means that memory required by database sessions also comes from the 3GB limit. If your memory usage goes beyond 3GB you wont be able to connect new sessions with database or you would require to reduce the size of one of your SGA components.
    Linux is a process based architecture where each user session is treated as a separate process and has its own addressable space. Even on 32bit linux the addressable space is 4GB i.e. 2GB for process and 2GB for kernel. It means we need to accommodate our SGA and PGA in the 2GB limit (there are ways to increase the size of SGA but let assume we are doing nothing to raise the 2GB limit).
    As PGA is allocated for every session when it connects with database.
    My question is how PGA memory is allocated against a database session on linux.
    To further clarify my question I am stating the results of an experiment that I did on linux and windows.
    On windows I set the total size of SGA to 1730M and PGA aggregate target to 1024M. I was able to able to startup the database instance without any issue. Then I started connecting sessions with the database and even ran a query doing a heavy sort in one of the sessions but after connecting 10 sessions with DB I started getting ORA-12500 TNS Listener failed to start a dedicated server process error on windows.
    Then I did the same experiment on Red Hat Linux. SGA size was 1633MB and where as PGA aggregate target was only 10MB. I was unable to start instance when I set the SGA size more than 1633MB.
    With that setting I was able to connect more than 200 sessions with database inspite of running query doing heavy sort in 4 sessions without getting ORA-12500 error. I was even able to connect more than 400 sessions with database after setting PGA aggregate target to 1GB on Linux.
    Now my confusion is why linux was able to handle more DB sessions. I know it’s a process base model and each session is a separate process and has its own addressable space but as PGA is allocated against every session and PGA memory comes from 2GB limit then why PGA memory did not exhaust on linux. Is PGA allocated differently on linux as compared to windows?

    Perhaps the problem is easier to understand if you leave PGA_AGGREGATE_TARGET out of this issue completely.
    The out of memory problem you had, has nothing to do with PGA_AGGREGATE_TARGET setting directly. The difference in number of processes comes from architectural differences in how Oracle uses memory in windows vs unix.
    On windows the SGA + ALL PGAs must fit into one 4GB address space (in practice even smaller as youve noticed). This is because there's only one process, oracle.exe. One process = one address space.
    On Unix, you have many processes and every process can use portion of their own address space for PGA.
    So, on windows (32bit) you run out of address space for the single oracle.exe process. On unix you dont hit this limit just because the number of processes grows (but if some process wants to use a lot of PGA memory, then they eventually run out of address space (talking about 32bit again))
    On unix you probably ran into another limit - amount of total usable virtual memory (RAM+swap) available in your system
    Tanel Poder
    http://blog.tanelpoder.com

  • File transfer between Mac and Windows

    I am running Windows on my Mac and I transfer files between mac and Windows alot using my external hard drive. I was wondering if there was an easier way to do this than having to use my external hard drive like a networking solution or something. Thanks...

    i also run windows on my mac (for work). The issue i had was that when booted in osx, i could see the windows partition, and copy files FROM it to the mac side, but i could not copy files TO the windows partition.
    As i understand it, this is because the apple NTFS driver (to read the windows partition) only allows read access (not read and write access). It was easily solved with MacFuse (which is an open source way to add different disk file systems to your mac, kind of like teaching it a new language), and NTFS-3G for mac osx.
    http://macntfs-3g.blogspot.com/
    scroll down a bit for the download link. The installer will put in MacFuse and NTFS-3G, so it's the only one you need.
    After a reboot, i can read/write to the windows partition while booted into macosx (and it's free).
    i hope that helps.
    p.s. the efi boot manager download is NOT required.

  • Why we have separate azure java SDK for linux and windows

    I saw different links for downloading azure java SDK for linux and windows.
    What difference does it actually have when java is platform independent? Or both are same jars?

    Hi,
    Thank you for your post.
    It contains the same jar files.
    Regards,
    Mekh.

  • Running jar in Linux and Windows

    Hi
    I created a jar file in Linux and it is running fine under Linux.
    But when I tried to run the same jar under windows,I got the following error
    Exception in thread "main" java.lang.NoClassDefFoundError:
    Is there any difference between running jar files in Linux and Windows?

    Hi
    I have a jar(say program.jar) containing a program which uses some libraries(again some jar files).The manifest file is written to look for the library jar files in the current directory.
    Main-Class: package_name.program_name
    Class-Path: fits.jar image.jar util.jar myutil.jar
    But while running the jar file in WINDOWS (java -jar program.jar <parameter list>)
    the following error occurs:
    Exception in thread "main" java.lang.NoClassDefFoundError:
    nom/tam/fits/Data"
    the class Data is present in the fits.jar jarfile.
    The same jar(run in the same manner)does not give any problems in Linux

Maybe you are looking for