Re: Problems loading an ImageIcon into a JLabel in a JApplet

This applet refuses to load images whose names it reads from a file in the makeList() method below. It will read the same image in if I hardcode in the file name
Well, have you checked to see that what is being read is the same as what you were hardcoding?

Assuming that your image icon is being loaded correctly, the following will solve your problem.
Replace these lines:
JLabel label = new JLabel((String)value, icon,
CENTER);
return label;with these:
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
setIcon(icon);
return this;
This works because DefaultTableCellRenderer extends JLabel, and returns itself as the renderer component.

Similar Messages

  • Inserting an ImageIcon into a JLabel

    Hello.
    I'm trying to insert an ImageIcon into a JLabel
    component which includes text.
    I want this JLabel to be a cell in a JTable,
    so i'm trying to add the ImageIcon inside the method
    public Component getTableCellRendererComponent
    (JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column)
    of class
    public class ClientCellRenderer extends
    DefaultTableCellRenderer
    the code regarding the ImageIcon is:
    JLabel label = new JLabel((String)value, icon, CENTER);
    return label;
    this code resides inside getTableCellRendererComponent.
    for some reason i don't see the ImageIcon in the JTable,
    although i see the text (which is (String)value).
    i hope someone could help me.
    thanks,
    Topa.

    Assuming that your image icon is being loaded correctly, the following will solve your problem.
    Replace these lines:
    JLabel label = new JLabel((String)value, icon,
    CENTER);
    return label;with these:
    super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    setIcon(icon);
    return this;
    This works because DefaultTableCellRenderer extends JLabel, and returns itself as the renderer component.

  • There is problem loading the outline into the memory, error # 1,250,005

    Hello,
    I am getting error message when opening ASO outline on edit mode in EAS 7.1.5 version. EAS server using weblogic and MYSql.
    Error Message:
    There is problem loading the outline into the memory, error # 1,250,005.
    Please let me know if any have experienced same issue or any suggestions.
    Regards,
    DS

    That error is documented as:
    ##1250005 Error [%s] Creating Environment For Outline Paging File: %s
    It sounds like it may be an issue with your temp directories (disk space?) as I believe it is going to copy the outline to a temp directory locally before opening it. That is where I would start looking..
    Tim Tow
    Applied OLAP, Inc

  • I am having problems loading sampler patches into the exs24 sampler, when i got into edit menu and load multiple samples all the samples r greyed out and i cannot slect them, any help with this would be much appreciated

    I am having problems loading sampler patches into the exs24 sampler, when i got into edit menu and load multiple samples all the samples r greyed out and i cannot slect them, any help with this would be much appreciated

    It is very difficult to offer troubleshooting suggestions when the "os version" you are using is unknown as each os has their own troubleshooting solutions. 
    How large is your hard drive and how much hard drive space do you have left? 

  • Problem loading .orf files into photoshop

    I have CC on both an iMac and a MacBook Pro
    .orf files will load into photoshop on the iMac but not on the MacBook Pro.  A popup appears which states need to update for latest RAW files.  I have run and installed the latest update but without success.  Since updating I've tried switching off and back on but with no success.
    What do I do next?

    Thanks partial success
    ACR was 8.3.  I've uploaded version 8.6 using the link provided and now able to read files into photoshop but
    1. Mini bridge does not show thumbnails only a place holder with no image
    2. The version on the iMac is 8.4 which I will also update but on both computers clicking on product update on Apple menu did not show the latest ACR update.  How can I arrange for auto updates without continually checking using the above link whether an update is available.

  • Problem loading one SWF into another in Flash AS3

    I am trying to load an SWF file in another SWF file. The child SWF file works fine when run standalone like if I set visibility of an item to true or false, it works fine. But when the SWF is loaded into a parent SWF, I am not able to execute such commands, neither I get any errors...

    are both swfs as3 swfs?
    is the code in the loaded swf and is that code referencing objects in the loaded swf?

  • Problems loading Flex3 swf into AIR app

    This is a challenging problem that I have reduced down to the
    bare minimum and it is still reproduceable. I have built a minimal
    AIR application and added a SWFLoader to it which loads a SWF file
    named "Junk.swf" using an absolute path.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute" title="Hello World">
    <mx:Style>
    WindowedApplication {
    background-color:"0x999999";
    background-alpha:"0.5";
    </mx:Style>
    <mx:SWFLoader
    source="C:/myProjectFolder/renderers/Junk.swf" width="100%"
    height="100%" />
    </mx:WindowedApplication>
    This works fine if I run the application from within Flex3,
    however when I build an installer, install the application to my
    windows vista system and execute it from the desktop the Junk.swf
    will not display. If I replace the Junk.swf with another SWF of the
    same name created in Flash CS3 then it will display properly when
    my test app is executed from either Flex or the desktop.
    The contents of the loaded SWF don't appear to be an issue
    since even the simplest of Flex3 SWFs fail to display.
    Interestingly when I add listeners to the SWFLoader to
    determine if any errors are happening no error events are sent, but
    I do receive both the INIT and COMPLETE events which tells me that
    the Junk.swf is found and loaded, just not displayed.
    Any assistance or even ideas that I could try would be
    appreciated.

    that's why i added those comments about the swf's domain.  for locally loaded swfs, use:
    SFMltd wrote:
    Hi Kglad, Thanks for the Example.
    if i run my class with securityDomain = SecurityDomain.currentDomain; then it throws this error: SecurityError: Error #2142: Security sandbox violation: local SWF files cannot use the LoaderContext.securityDomain property.
    The swf file im trying to load is stored locally so i guess this error makes sense. However if i comment out that line i get the same "cannot access Stage owned by app" error?
    See below for class:
    package  {
      import flash.display.MovieClip;
      import flash.filesystem.File;
      import flash.events.Event;
      import flash.net.FileReference;
      import flash.events.MouseEvent;
      import flash.display.Loader;
      import flash.net.URLRequest;
      import flash.system.LoaderContext;
      import flash.system.ApplicationDomain;
      import flash.system.SecurityDomain;
      public class assetPreview extends MovieClip {
      private var loader:Loader;
      private var mainSWF:MovieClip = new MovieClip();
      public function assetPreview() {
      addEventListener(Event.ADDED_TO_STAGE, initialise);
      public function initialise(e:Event):void
      removeEventListener(Event.ADDED_TO_STAGE, initialise);
      var allowSWF:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
    // allowSWF.securityDomain = SecurityDomain.currentDomain;
      loader = new Loader();
      loader.load( new URLRequest(settingsXML.pathToSWF),allowSWF);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE, viewPreview);
      public function viewPreview(e:Event):void
      addChild(mainSWF);
      mainSWF.addChild(loader);

  • Problem Loading an Image with javax Swing from a JApplet

    First of all, i use JCreator as java creater and have the newest version of java sdk version.
    Now i need to load an image from the harddrive on which the JApplet is located. I need to do this from inside the JApplet. I have put my pictures in a map 'images' which is located in the same directory as the classes + htm file. It works from inside JCreator, but as soon as i open the normal htm it just WON'T load that image (grmbl).
    Here is my code for loading the image:
    public BufferedImage loadImage (String filename, int transparency)
         Image image;
         if (app)
              image = Toolkit.getDefaultToolkit().getImage(("./images/"+filename));
         else
              String location = "";
              location = "./images/"+filename;
              image = Toolkit.getDefaultToolkit().getImage(location);
         MediaTracker mediaTracker = new MediaTracker(new Container());
         mediaTracker.addImage(image, 0);
         try
              mediaTracker.waitForID(0);
         catch (Exception e)
    Could anybody help me out here??
    I tried a url already using getCodeBase() or getDocumentBase() but that gives an error because it cannot find those if using a JApplet.

    Why don't you use javax.swing.ImageIcon? If you already have a flag telling if it's an application or applet, use the getDocumentBase() to base the URL in the applet part only.

  • Load a redrawn image into a JLabel and save it into a BufferedImage?

    Hello, I'm doing a small application to rotate an image, it works, but I'd like to show it into a JLabel that I added, and also store the converted image into a BufferedImage to save it into a database, this is what I have so far:
    public void getImage() {
    try{
    db_connection connect = new db_connection();
    Connection conn = connect.getConnection();
    Statement stmt = conn.createStatement();
    sql = "SELECT image " +
    "FROM image_upload " +
    "WHERE image_id = 1";
    rset = stmt.executeQuery(sql);
    if(rset.next()){
    img1 = rset.getBinaryStream(1);
    buffImage = ImageIO.read(img1);
    rset.close();
    } catch(Exception e){
    System.out.println(e);
    public void paint(Graphics g){
    super.paint(g);
    Graphics2D g2 = (Graphics2D) g;
    ImageIcon imgIcon = new ImageIcon(buffImage);
    AffineTransform tx = AffineTransform.getRotateInstance(rotacion, imgIcon.getIconWidth()/2, imgIcon.getIconHeight()/2);
    g2.drawImage(imgIcon.getImage(), tx, this);
    jLabel1.setIcon(imgIcon);
    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {
    // TODO add your handling code here:
    setRotacion(getRotacion() + 1.5707963249999999);
    repaint();
    I get the image from a db, then using the paint() method I rotate the image, it works, but the new image is outside of the JLabel and I don't know how to assign the new one into the JLabel (like overwritting the original) and also how to store the new image into a BufferedImage to upload it into the database converted, thanks in advanced, any help would be appreciated, thanks!!
    Edited by: saman0suke on 25-dic-2011 14:07
    Edited by: saman0suke on 25-dic-2011 15:08

    I was able already to fill the JLabel with the modified content, just by creating a new BufferedImage, then create this one into a Graphics2D object and the drawing the image into it, last part, inserting the modified image into the database, so far, so good, thanks!
    EDIT: Ok, basic functionality is ok, I can rotate the image using AffineTransform class, and I can save it to the database and being displayed into a JLabel, now, there's a problem, the image for this example is 200 width and 184 height, but when I rotate it the width can be 184 and the height 200 depending on the position, but the BufferedImage that I create always read from original saved image:
    bimage = new BufferedImage(buffImage.getWidth(), buffImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
    Is there a way that I can tell BufferedImage new width and height after rotate it? :( as far as I understand this cannot be done because before the image bein rotated the bufferedImage is already created and, even being able to do it how can I get width and height from rotated image? thanks!
    Edited by: saman0suke on 25-dic-2011 19:40

  • Problem loading data into write optimized dso.....

    Hi ,
    I am having problem loading the data from PSA to write optimised DSO
    I have changed the normal DSO into a Write Optimised DSO. I have 2 data sources to be loaded into the write optimized DSO. One for Demand and one for Inventory.
    The loading of Demand data from PSA to DSO happens fine with out any error.
    Now while loading the Inventory data from PSA to DSO , i get the below errors
    "Data Structures were changed. Start Transaction before hand"
    Execption CX_RS_FAILED Logged
    I have tried reactivating the DSO, Transformation, DTP and tried to load the data again to the write optimised DSO, but no luck, I get the above error message always.
    Can some one please suggest me what could be done to avoid the above error messages and load the data successfully.
    Thanks in advance.

    Hi,
    Check the transformations is there any routines written.
    Check your Data struture of cube and DS as well.
    Is there any changes in structure.
    Data will load upto PSA normally, if is there any changes in struture of DSO, then the error may occur.just check it.
    Check the below blog:
    /people/martin.mouilpadeti/blog/2007/08/24/sap-netweaver-70-bi-new-datastore-write-optimized-dso
    Let us know status.........
    Reg
    Pra

  • Performance problems loading an XML file into oracle database

    Hello ODI Guru's,
    I am trying to load and XML file into the database after doing simple business validations. But the interface takes hours to complete.
    1. The XML files are large in size >200 Mb. We have an XSD file for the schema definition instead of a DTD.
    2. We used the external database feature for loading these files in database.
    The following configuration was used in the XML Data Server:
    jdbc:snps:xml?f=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xml&d=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xsd&re=initialLoad&s=CM&db_props=oracle&ro=true
    3. Now we reverse engineer the XML files and created models using ODI Designer
    4. Similar thing was done for the target i.e. an Oracle database table as well.
    5. Next we created a simple interface with one-to-one mapping from the XSD schema to the Oracle database table and executed the interface. This execution takes more than one hour to complete.
    6. We are running ODI client on Windows XP Professional SP2.
    7. The Oracle database server(Oracle 10g 10.2.0.3) for the target schema as well as the ODI master and work repositories are on the same machine.
    8. I tried changing the following properties but it is not making much visible difference:
    use_prepared_statements=Y
    use_batch_update=Y
    batch_update_size=510
    commit_periodically=Y
    num_inserts_before_commit=30000
    I have another problem that when I set batch_update_size to value greater that 510 I get the following error:
    java.sql.SQLException: class org.xml.sax.SAXException
    class java.lang.ArrayIndexOutOfBoundsException said -32413
    at com.sunopsis.jdbc.driver.xml.v.a(v.java)
    The main concern is why should the interface taking so long to execute.
    Please send suggestions to resolve the problem.
    Thanks in advance,
    Best Regards,
    Nikunj

    Approximately how many rows are you trying to insert?
    One of the techniques which I found improved performance for this scenario was to extract from the xml to a flat file, then to use SQL*LOADER or external tables to load the data into Oracle.

  • URGENT: Problems Loading files with SQL Loader into a BLOB column

    Hi friends,
    I read a lot about how to load files into blob columns, but I found errors that I can't solve.
    I've read several notes in these forums, ine of them:
    sql loader: loading external file into blob
    and tried the solutions but without good results.
    Here are some of my tests:
    With this .ctl:
    LOAD DATA
    INFILE *
    INTO TABLE mytable
    REPLACE
    FIELDS TERMINATED BY ','
    number1 INTEGER EXTERNAL,
    cad1 CHAR(250),
    image1 LOBFILE(cad1) TERMINATED BY EOF
    BEGINDATA
    1153,/opt/oracle/appl/myapp/1.0.0/img/1153.JPG,
    the error when I execute sqlldr is:
    SQL*Loader-350: Syntax error at line 9.
    Expecting "," or ")", found "LOBFILE".
    image1 LOBFILE(cad1) TERMINATED BY EOF
    ^
    What problem exists with LOBFILE ??
    (mytable of course has number1 as a NUMBER, cad1 as VARCHAR2(250) and image1 as BLOB
    I tried too with :
    LOAD DATA
    INFILE sample.dat
    INTO TABLE mytable
    FIELDS TERMINATED BY ','
    (cad1 CHAR(3),
    cad2 FILLER CHAR(30),
    image1 BFILE(CONSTANT "/opt/oracle/appl/myapp/1.0.0/img/", cad2))
    sample.dat is:
    1153,1153.JPEG,
    and error is:
    SQL*Loader-350: Syntax error at line 6.
    Expecting "," or ")", found "FILLER".
    cad2 FILLER CHAR(30),
    ^
    I tried too with a procedure, but without results...
    Any idea about this error messages?
    Thanks a lot.
    Jose L.

    > So you think that if one person put an "urgent" in the subject is screwing the problems of
    other people?
    Absolutely. As you are telling them "My posting is more important than yours and deserve faster attention and resolution than yours!".
    So what could a typical response be? Someone telling you that his posting is more important by using the phrase "VERY URGENT!". And the next poster may decide that, no, his problem is evern more import - and use "EXTREMELY URGENT!!" as the subject. And the next one then raises the stakes by claiming his problem is "CODE RED! CRITICAL. DEFCON 4. URGENT!!!!".
    Stupid, isn't it? As stupid as your instance that there is nothing wrong with your pitiful clamoring for attention to your problem by saying it is urgent.
    What does the RFC's say about a meaningful title/subject in a public forum? I trust that you know what a RFC is? After all, you claim to have used public forums on the Internet for some years now..
    The RFC on "public forums" is called The Usenet Article Format. This is what it has to say about the SUBJECT of a public posting:
    =
    The "Subject" line (formerly "Title") tells what the message is about. It should be suggestive enough of the contents of the message to enable a reader to make a decision whether to read the message based on the subject alone. If the message is submitted in response to another message (e.g., is a follow-up) the default subject should begin with the four characters "Re: ", and the "References" line is required. For follow-ups, the use of the "Summary" line is encouraged.
    =
    ([url http://www.cs.tut.fi/~jkorpela/rfc/1036.html]RFC 1036, the Usenet article format)
    Or how about [url http://www.cs.tut.fi/~jkorpela/usenet/dont.html]The seven don'ts of Usenet?
    Point 7 of the Don'ts:
    Don't try to catch attention by typing something foolish like "PLEASE HELP ME!!!! URGENT!!! I NEED YOUR HELP!!!" into the Subject line. Instead, type something informative (using normal mixed case!) that describes the subject matter.
    Please tell me that you are not too thick to understand the basic principles of netiquette, or to argue with the RFCs that governs the very fabric of the Internet.
    As for when I have an "urgent" problem? In my "real" work? I take it up with Oracle Support on Metalink by filing an iTAR/SR. As any non-idiot should do with a real-life Oracle crisis problem.
    I do not barge into a public forum like you do, jump up and down, and demand quick attention by claiming that my problem is more important and more urgent and more deserving of attention that other people's problem in the very same forum.

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • I have a problem, I had to reload my hard drive, I didnt erase it, I load xp pro into another folder(windows2) and everything(files) remained in regular(corrupt) windows folder. System32 error came up and corrupt it and it couldnt load the os. I want to

    I have a problem, I had to reload my hard drive, I didnt erase it, I load xp pro into another folder(windows2) and everything remained in regular windows folder. System32 got corrupt and it couldnt load the os. I want to be able to bring my bookmarks over from windows into current windows2, how do I do it.

    See this:
    http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile

  • HT204053 Hi all, I am constantly running into problems opening iCloud services (mail, calendars, iWork's, etc.). I get a message stating i.e. Can't load Mail (Calendar, iWork), There was a problem loading the application. Does anybody know what a heck is

    Hi all, I am constantly running into problems opening iCloud services (mail, calendars, iWork's, etc.). I get a message stating i.e. Can't load Mail (Calendar, iWork), There was a problem loading the application. Does anybody know what a heck is going on?

        I can see that this issue has been quite extensive, and frustrating, and I am so sorry for all that has happened societygirl! I would like to help you work this issue out. Please follow & send me a Direct Message, so I can get your account specifics and help finally bring this to a resolution.
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • How to get client Ip address from web service

    Hello folks, I am quite new to web service and developing a web service using netbeans6.0 IDE, where i have to know which client called/used the service, After googling i got code snippet like below inject a WebServiceContext instance into your WebSe

  • How can i restrict user to access database object (procedure) or JSP

    Hi I have 9ias infrastructure 902, on win2k box with 9i DB. and I have one PL/SQL web application and another J2EE application both are hosted by 9ias 902. Now we are looking forward to couple both with SSO. I have deloyed samples of both and works f

  • Oracle 10g on RHEL 5.3 - Problem

    Hello. I m new to LINUX and ORACLE. I try to install Oracle 10g on my RHEL 5.3 and it shows the following problem... ./runInstaller Starting Oracle Universal Installer... Checking installer requirements... Checking operating system version: must be r

  • Apple Pro speakers with mini jack connect to new Intel iMac ?

    I would like to be able to connect the pair of perspex globe Apple Pro Speakers with mini-jack that came with my PowerPC G4 Mac to my new Lion desktop Intel iMac. However, the mini-jack is too small for either the ' audio in / optical digital audio i

  • W540 and Ultradock Display Port Issue with Monoprice 27" Monitor

    Hi, I have been troubleshooting an issue with my W540 and Ultradock for over a month now.  The issue is that the display port will not recognize my Monoprice 27" monitor.  This same monitor was working previously with my W520 and a different dock (Th