Using ImageIcon in Linux

Hi,
I tried to use jpg image inside JLabel. This is working in Windows. But I tried in RedHat Linux 9. I can't see the jpg image inside the label. I have included the code.
Thanks in advance.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
class jpgTest extends JFrame
     public jpgTest()
          super("jpg image test");
          Container cpane=getContentPane();
          cpane.setLayout(new FlowLayout());
          File jpgFile=new File(System.getProperty("user.dir"),"folder.jpg");
          JLabel lblImage=new JLabel("folder.jpg",new ImageIcon(jpgFile.getAbsolutePath()),JLabel.CENTER);
          lblImage.setVerticalTextPosition(JLabel.BOTTOM);
          lblImage.setHorizontalTextPosition(JLabel.CENTER);
          cpane.add(lblImage);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          Toolkit t=Toolkit.getDefaultToolkit();
          Dimension d=t.getScreenSize();
          setSize(d.width,d.height-30);
          setVisible(true);
          setExtendedState(JFrame.MAXIMIZED_BOTH);
     public static void main(String args[])
          new jpgTest();
}

Your code worked fine for me. Maybe your image got messed up when you copied it from Windows to Linux (if you use FTP without setting binary mode, that will happen).
Can you see the JPEG with your browser?

Similar Messages

  • Any issues with using LDAP on LINUX for GRC 5.2 UME?

    Our company is converting our LDAP servers from AIX to LINUX.  The DNS name used in our UME connection should not change.  Are there any issues with using LDAP on LINUX?  We are currently on GRC 5.2 SP9 (in the middle of upgrading to SP12).
    Also, I have been trying to connect our test UME system to a test LDAP box that has already been converted to LINUX but keep getting a 'connection failed' error when I try to test it. 
    Do you have to reboot the server to test changing the LDAP connections?  I've been trying it by going into UME, pulling up the LDAP tab, hitting the Modify button, entering the new userid and password for test LDAP, and hitting the Test Connection button.  I've verified that this userid and password is correct for test LDAP.
    Is there a way to get more information about why the connection failed?
    Thanks.

    I've been told by our LDAP Support group that none of the other configuration settings should have to be changed.  I should only have to change the id and password to connect to a test version of LDAP instead of our regular connection to the production LDAP.
    Can you test a connection for a different userid/password without having to reboot/restart the server?  Do I need to change these two settings, save then, reboot/restart, and then do the Test Connection button?
    Thanks.

  • How to run SAP BUSINESS ONE 8.8 clients on windows and use MaxDB on linux/W

    Good day,
    As the subject shows we have SAP BUSINESS ONE 8.8 and I want to find out how to use it in combination with MaxDB instead of MS SQL. I find a lot of MaxDB stuff on the net but no guides on how to setup SAP BUSINESS ONE 8.8 clients on windows workstations and connect them to MaxDB.
    Is this possible and if so how do I go about doing it ?
    Any assistance is greatly appreciated .

    Hi,
    I suggest you to check the supported server for B1 in this link:
    http://service.sap.com/smb/sbo/platforms
    You will know the sap b1 supported platform.
    If you really want to use maxDB on linux/W as B1 server, you can send a development request to SAP AG.
    JimM

  • How do I combine multiple PDF using PHP on Linux

    Hi,
    I would like to know if there is an Adobe product that can combine multiple PDF's into a single document and works on Linux? We are developing an application using PHP on Linux that has to combine selected PDF's and would like to know if there is a tool with api's (or command line interface) to allow that.

    Adobe licenses the PDF Library SDK for native developers on Linux platforms (as C code). They do not supply PHP tools.

  • Trying to use 10G for linux

    Two Problems
    1. I downloaded 10 for linux,
    used gunzip
    Now I am at ship.db.cpio
    I ran cpio -idmv ship.db.cpio
    The command never stoped, what did I do wrong ???
    Next problem
    The 10G for linux state:
    I need to change on my linux computer,
    sysctl.conf, pam.d/login, limits.conf, profile
    There all read only files,
    What do I need to do ????
    I am using Red hat linux EP. rev 3 newest one.

    1. Use cpio -idmv <ship.db.cpio
    sysctl.conf, pam.d/login, limits.conf, profileThese are system files : you have to login as root to modify them, or su - root if you are already connected as another user.

  • How to use ImageIcon's byte[] constructor?

    As subject states
    I've tried many many times and I just cna't get it. I can get it working using ImageIcon's String (filename) constructor, but the application I'm developing for requires the use of a byte[] array.
    Could someone please share some code that reads data from an image file (jpg preferably) and converts it into an array of bytes and uses that to (successfully!) create a working ImageIcon?
    Thanks

    It should work to use a BufferedInputStream instead of BufferedReader and InputStreamReader. I tried this test code.
    public static void main(String[] args) throws Exception {
            ArrayList byteList=new ArrayList();
            byte[] inbytes={12,-127,-126,-2};
            ByteArrayInputStream bas=new ByteArrayInputStream(inbytes);
            BufferedInputStream br=new BufferedInputStream(bas);
            byteList.add(new Integer(br.read()));
            byteList.add(new Integer(br.read()));
            byteList.add(new Integer(br.read()));
            byteList.add(new Integer(br.read()));
            byte[] byteArray = new byte[byteList.size()];
            for(int i=0;i<byteArray.length;i++) {
                 byteArray=(byte) (((Integer) byteList.get(i)).intValue());
    System.out.println(byteArray[i] );
    It displays the same values as the original inbytes values. When I tried the same code except using InputStreamReader and BufferedReader, I did not get the original inbytes values. There's character encoding with a Reader that may change the values. Streams give the raw data.

  • Need list of indian s/w companies using Oracle on Linux

    Hi,
    I am in need of the list of companies in India who use Oracle on Linux, if any one has such an list then please do send it to me at [email protected]
    I am exploring the companies names ,so that I can apply for the post of 'Oracle DBA' on LINUX platform,thus if i could obtain such a list then my job hunt will become much easier.
    So,if any one has got such info then please do pass it on to me .
    Krishna k.
    09819152725

    It's been discussed before,
    Re: Want to use SGA=3gb+  in  RHEL 4.3 (32bit)
    There's some work around with performance penalty

  • Using CF8 on Linux

    Ok, I'm new to using CF on Linux, so here's my question.
    On Windows you have to tell CF what sites you want the CF
    server to serve up
    pages for. Is there a similar way to do this in Linux?
    I installed CF on Fedora, and can get to the CF admin page
    via Firefox just
    fine. When I try to view a webpage on
    http://localhost/page.cfm it
    displays
    the page, but the CF tags aren't being translated, they show
    up as text on
    the page.....

    Steve,
    How are you getting to CFAdmin? Does your URL include port
    8500 or similar? If so, the administrator is working thru
    coldfusion's internal webserver (JWS). I suspect that is what is
    going on.
    If that is the case, review the installation guide for
    configuring webservers. You will have several options to get CF
    connected to apache or whatever webserver you are running. Also,
    details like CF version, webserver type, etc. are useful when you
    post.

  • Dataload error using MaxL on LINUX

    Hi All,
    I'm using Essbase 11.1.2.1 & working on ASO cube. I'm trying to load the data using Maxl on LINUX.
    This is the following error: essmsh error: End of File breaks the Statement.
    any ideas.......
    Thanks,

    rasch wrote:
    Hi,
    I am using DAQmx-base (C library) on Linux with a USB-6009 device. When I am acquiring data
    using DAQmxBaseReadAnalogF64() (the code is based on the example contAcquireNChan.c)
    everything works, but when I am using DAQmxBaseReadBinaryI16() the following error
    happens:
    DAQmxBase Error: Value passed to the Task/Channels In control is invalid.
    Everything is the same just the ...AnalogF64 is replaced by the ...BinaryI16 function call
    (of course the buffer used for storing the data was also changed from float64 to in16).
    Does anyone know what settings (or missing settings) result in this error?
    Every explanation or pointer to some documentation is welcome. I already checked the
    C reference HTML documentation coming with DAQmx-base without success.
    Thanks
    Raphael
    From the ReadMe file for DAQmx Base on Macintosh OS X:
    NI USB-9211
    *Analog Input
    -Multi-channel, multi-sample read (scaled)
    -Multi-channel, single sample read (scaled)
    NI USB-9215
    *Analog Input
    -Multi-channel, multi-sample read (scaled)
    -Multi-channel, single sample read (scaled)
    NI USB-6008/9
    *Analog Input
    -Digital start triggering
    -Multi-channel, multi-sample read (scaled)
    -Multi-channel, single sample read (scaled)
    Raw input simply isn't supported for the USB devices. I would guess that the situation for Linux is the same, since DAQmx Base is based on Labview code in order to achieve cross-platform portability. See the thread
    http://forums.ni.com/ni/board/message?board.id=250&message.id=11873
    and, for a slightly different problem:
    http://forums.ni.com/ni/board/message?board.id=250&message.id=11963
    Be sure to read down to where there is a message indicating that support for USB devices is planned for NI-DAQmx. Of course, that won't help on Macintosh and Linux.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • How to use jdeveloper with linux?

    how to use jdeveloper with linux?
    Hello, i've download jdeveloper, and i have java1.4 installed. But i can't run jdeveloper i have jdev.exe and jdev but when i put /usr/local/jdev/bin/jdev a have a message like file not found. I don't know what to do.
    Help please!!!
    Ori.

    You need to go to the directory where you unzipped JDeveloper, for example:
    cd opt/jdev/jdevj2eebase1013/jdev/bin
    Once there, do this:
    chmod +x jdev
    chmod +x ojc
    Now you can try this:
    nohup ./jdev &
    or simply
    ./jev
    I usually create a soft link in ~/bin

  • Sendmail using sendmail of Linux

    could someone help me with the problem:
    I need to send mails using sendmail of linux(I cannot user JavaMail API) using Java.
    Thanks in advance.
    Suman

    Hi, I can't find anything about sending email using java classes on the referd www. adress. Is it possible that you post some code about using /usr/sbin/sendmail on the server? Tnx

  • How to use DMA in linux?

    Hi,
    This is not exactly an area of my expertise, but I'd need to output analog signal with an M Series card in linux. I'm using the NI DAQmx Base driver and apparently it does not have any direct support for DMA access. As I understood, the NI DAQmx driver would have a support for DMA, but the newest version of driver for linux (openSUSE) is from 2005. With current implementation the output is not very steady as there are some other mandatory processes on the background and the driver already seems to be using nearly all of the CPU time. Any help would really be appreciated. Thanks in advance.
    -- mikko

    Hi mikko,
    DAQmx Base does support DMA, but only for analog input (which obviously doesn't match your application's needs).
    However, I don't believe you will need the DDK to support DMA for analog output on your hardware: installing DAQmx 8.0 is possible on newer Linux distributions, and one user in particular shared his procedure [1]. His instructions mention using NI-KAL 1.6, but my recommendation is to use the latest [2]. National Instruments hasn't tested DAQmx 8.0 on these newer distributions, so I can't say what the driver's performance would be in your situation. I can say, though, that I've installed DAQmx 8.0 on openSUSE 10.3 successfully and was able to use the shipping examples for an internal demonstration.
    If you encounter problems, please reply and tell me which hardware you want to use and which Linux distribution you're currently using. It will be much easier to install DAQmx 8.0 on a newer release of a supported distribution (like SUSE [3]) than a on an unsupported distribution.
    [1] Installing LabVIEW 8.2.1 with DAQmx 8.0 on Suse 10.3 for Linux.
    http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=331638#M331638
    [2] NI-KAL for Linux
    http://joule.ni.com/nidu/cds/fn/p/sb/navsRel/lang/en?q=ni-kal
    [3] National Instruments and Linux: Frequently Asked Questions
    http://www.ni.com/linux/support.htm#1
    Joe Friedchicken
    NI VirtualBench Application Software
    Get with your fellow hardware users :: [ NI's VirtualBench User Group ]
    Get with your fellow OS users :: [ NI's Linux User Group ] [ NI's OS X User Group ]
    Get with your fellow developers :: [ NI's DAQmx Base User Group ] [ NI's DDK User Group ]
    Senior Software Engineer :: Multifunction Instruments Applications Group
    Software Engineer :: Measurements RLP Group (until Mar 2014)
    Applications Engineer :: High Speed Product Group (until Sep 2008)

  • Can i use ituens on linux sytems ?

    Is there any way to install and use itunes on Linus systems such as "Ubuntu" ?

    Hello Mr.Roger i finished studying audio engineering last year,its really nice to meet you
    i found some ways to use iTunes on Linux but i think its not an official versions or not legal that's why i wanted to make sure
    thank you anyway

  • Can i use itunes on linux ....how

    can i use itunes on linux ....how

    Yes, although not natively. You can install iTunes under the Wine framework (see http://www.junauza.com/2010/07/how-to-install-itunes-on-ubuntu-linux.html). Wine allows Linux to run Windows applications by doing a  translation of Windows APIs to the equivalent Linux system calls.
    You could also install a Windows Virtual Box using VMWare or Virtual Box, and then install iTunes in the VM.

  • Can you use itunes with Linux computer?

    Im using Ubuntu, a linux based operating system and would like to still use itunes. Is this possible?

    No. It has never been migrated to Linux.
    With the current market share that Linux has, I seriously doubt that it will ever be migrated to that platform.

Maybe you are looking for

  • USB Printing AirPort Extreme 802.11n

    I've upgraded to the new AirPort Extreme 802.11n base station and am having troubles printing to printers that worked fine with my previous AirPort Extreme 802.11g base station. Both USB printers are detectable for set-up in the Print & Fax Preferenc

  • How do get attachment without triggering flag chaging from unread to read?

    Hi all, In IMAP, is there anyway to get the attachment without flipping the flag from unread to read? here's my code: store = session.getStore(IMAP); store.connect("someHost", somePort, "someLoginName", "somePwd"); folder = (IMAPFolder)store.getFolde

  • 8 years of loyal customer, today is the first I've been dissapointed....

    I had '1000 BONUS MINUTES 2 YR RENEWAL' and '1000 BONUS MIN SHARE SECONDARY 2 YR RENEW'.  It doesn't say "...FOR 2 years".  Just an additional description of "2 YR RENEWAL".  When I first got these bonus minutes, I asked the rep if there was expirati

  • Loss of features with 2.3.4 update

    I just got the gingerbread update for my incredible and it seems that features I used multiple times a day in froyo are gone. 1. During the day my phone is sitting on a desk in a landscape position. Before the update when I turned the screen of after

  • Live Trace Raster Preview Btn doesn't work in Ai CS5

    Hello, I'm working with tracing graphics in Illustrator CS5 (I know, that's not the newest version of the software), I came across such a problem: Live trace mode offers 2 preview buttons: vector (white pyramid button) and raster (black pyramid butto