Using images files without javax.swing

I am developing an applet the user can designate a background image instead of a color. This applet must not use the javax package. What class would you all recommend for creating the background image. I can't use IconImage because it is part of the javax package.
Thanks

checkout the Graphics class too. It has a drawImage function that paints the image class on awt components. However you must override the the paint(Graphics g) method of the component in order to display your image.

Similar Messages

  • How to use vector file without adobe illustrator?? please help

    I am using the free trial period of adobe illustrator to creat a logo.  I don't want to buy illustrator b/c I don't plan on using the program for anything else,  I would like to save my logo in some kind of vector format so I can use it for lots of different printing options.  But I can't figure out how to do this b.c my computer won't open the file without illustrator.  Is there anyway to creat a usable print friendly logo without buying illustrator? Thanks for any help!

    I believe if you export it to wmf or emf you will have a Vector file that can be used in word or powerpoint and can be placed in other programs as can ai files which can be placed in word or powerpoint documents as vector files.
    Flash (swf) is another way of saving it and it is also vector.
    However even though you say you will never have use for Illustrator which is what I thought in 1995 when I use it to create a logo, I soon found more use for it and every year since have found a project that has rewarded me many times the cost of the application once I had purchased it. Most of which I never thought I had the need for and probably would not have even made the attempt to make the effort and the profit if I did not own the license.
    And every time I say to myself what do i have this application for the opportunities arises yet again.
    I thought I would share my experience with you.

  • Using image as background to Swing JPanel

    Hi,
    Have been trying to set background of JPanel to an image but cannot get it to work.
    Any ideas why not?! Here is the code Ive written:
    public Simple_Gui()
    //add the title for the frame
    super("Simple frame");
    this.getContentPane().setLayout(new FlowLayout());
    //add a window listener to close the window when the button is pressed
    this.addWindowListener(new WindowAdapter()
         public void windowClosing(WindowEvent we)     
              System.exit(0);
    //need a pane to hold the background image and buttons
         pane = createPanel();
    //this is the background image for the app to make it look lurrrvely
    ImageIcon imageIcon = new ImageIcon( "C://SDF_image.jpg" );
    //set the size of the Panel to the size of our image
    paneHeight = imageIcon.getIconHeight();
    paneWidth = imageIcon.getIconWidth();
    pane.setSize(paneWidth, paneHeight);
    //add the pane to the JFRAME so that it is visible
    this.getContentPane().add(BorderLayout.CENTER, pane);
    this.setVisible(true);
         public static JPanel createPanel()
              JPanel panel = new JPanel()
                   public void paintComponent(Graphics g)
              ImageIcon img = new ImageIcon("C://SDF_image.jpg");               Image image = img.getImage();
                   g.drawImage(image, 0, 0, this);                         super.paintComponent(g);                              }
              panel.setOpaque(false);
              panel.setLayout(new GridLayout(20, 4, 10, 10));
              panel.setVisible(true);
              return panel;
              public static void main(String[] args)
                   Smarty_Gui gui = new Smarty_Gui();
    Sorry about the indentation and format

    Something like this ...
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.*;
    public class UsingImageBackground extends JFrame {
    JPanel panel;
    JButton button = new JButton("OK!");
         public UsingImageBackground() {
       Container c = getContentPane();
         panel = new JPanel() {
              public void paintComponent(Graphics g)     {
                   ImageIcon img = new ImageIcon("new.jpg");
                   g.drawImage(img.getImage(), 0, 0, null);
                   super.paintComponent(g);
         panel.setOpaque(false);
         panel.add(button);
       c.add(panel);
         public static void main(String [] args){
              UsingImageBackground frame = new UsingImageBackground();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setSize(160, 120);
              frame.setVisible(true);
    }

  • How to use jar files without setting classpath

    Hi,
    I have a situvation, I can not set classpath, but i have to use jar files, how can I do that.

    URL[] urls = new URL[]{pathToJar, pathToAnotherJar, ...};
    URLClassLoader urlc = new URLClassLoader(urls);
    Now load classes within the jars loaded by the urlc classloader as needed. This is a limited approach, you can mostly use interfaces to work with classes loaded by the custom loader instance above and your existing classes.

  • Business Objects Customization Using Class file without net bean

    Hi,
    Any one please help me out.
    my requirement is like I want to use Business Objects SDK
    <%@ page import="com.crystaldecisions.sdk.framework.CrystalEnterprise" %>
    above is example..
    in Class file of Java without using netbean.
    I try to do this with creating Batch file add all Jar file and set path and but its not working.
    Also can I Login Into business Objects through class file not using netbean(means from command prompt)
    and create user group into CMS.

    Please find following servlet code who dont understand my requirement.
    * GroupCreation.java
    * Created on September 2, 2008, 3:47 PM
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import com.crystaldecisions.enterprise.ocaframework.ServiceNames;
    import com.crystaldecisions.sdk.exception.SDKException;
    import com.crystaldecisions.sdk.framework.CrystalEnterprise;
    import com.crystaldecisions.sdk.framework.IEnterpriseSession;
    import com.crystaldecisions.sdk.framework.ISessionMgr;
    import com.crystaldecisions.sdk.occa.infostore.IInfoStore;
    import com.crystaldecisions.sdk.occa.managedreports.*;
    import com.crystaldecisions.sdk.occa.security.ILogonTokenMgr;
    import javax.servlet.http.Cookie;
    import com.crystaldecisions.sdk.occa.infostore.*;
    import com.crystaldecisions.sdk.occa.pluginmgr.*;
    import com.crystaldecisions.sdk.plugin.CeProgID;
    import com.crystaldecisions.sdk.plugin.desktop.user.*;
    import com.crystaldecisions.sdk.properties.*;
    import javax.servlet.http.HttpSession;
    * @author prashant.joshi
    * @version
    public class GroupCreation extends HttpServlet
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException
    HttpSession session = request.getSession(true);
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    String cms = request.getParameter("CMS");
    String username = request.getParameter("UserID");
    String password = request.getParameter("Password");
    String auth = request.getParameter("Aut");
    IEnterpriseSession enterpriseSession = null;
    try
    ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
    catch(SDKException e)
    out.println(e.getMessage());
    Exception failure = null;
    boolean loggedIn = true;
         // If no session already exists, logon using the specified parameters.
    if (enterpriseSession == null)
    try
    // Attempt logon. Create an Enterprise session
    // manager object.
    ISessionMgr sm = CrystalEnterprise.getSessionMgr();
    // Log on to BusinessObjects Enterprise
    enterpriseSession = sm.logon(username, password, cms, auth);
    catch (Exception error)
    loggedIn = false;
    failure = error;
    if (!loggedIn)
    // If the login failed, redirect the user to the start page.
    out.println("<SCRIPT language=\"javascript\"> " +
    " alert (\"Sorry - you could not be logged on to this server." +
    " Ensure that your user name and password, as well as the CMS name are correct." +
    "\"); </SCRIPT>");
    out.println("<META HTTP-EQUIV='refresh' CONTENT='0;URL=LogonPage.jsp'>");
    return;
    else
    try
    // Store the IEnterpriseSession object in the session.
    session.setAttribute("EnterpriseSession", enterpriseSession);
    // Create the IInfoStore object.
    IInfoStore iStore = (IInfoStore) enterpriseSession.getService("InfoStore",
    ServiceNames.OCA_I_IINFO_STORE);
    // Store the IInfoStore object in the session using the
    // helper functions.
    session.setAttribute("InfoStore", iStore);
    // Create the IReportSourceFactory object.
    IReportSourceFactory reportSourceFactory = (IReportSourceFactory) enterpriseSession.getService("PSReportFactory");
    // Store the IReportSourceFactory object in the session
    // using the helper functions.
    session.setAttribute("ReportSourceFactory", reportSourceFactory);
    // Retrieve the logon token manager.
    ILogonTokenMgr logonTokenMgr = enterpriseSession.getLogonTokenMgr();
    // Retrieve a logon token and store it in the user's cookie
    // file for use later.
    Cookie cookie = new Cookie("LogonToken", logonTokenMgr.createLogonToken("", 60, 100));
    response.addCookie(cookie);
    // LOCUse the plugin manager and the UserGroup plugin to create a new
    // UserGroup object._ENDLOC_
    // LOCIf the infoStore object is not found then display an error message._ENDLOC_
    IInfoStore infoStore = (IInfoStore) session.getAttribute("InfoStore");
    // LOCIf the infoStore object is not found then display an error message._ENDLOC_
    if (infoStore == null)
    throw new Error("_LOC_InfoStore object not found. Please logon again._ENDLOC_");
    IPluginMgr pluginMgr = infoStore.getPluginMgr();
    //IPluginMgr pluginMgr2 = infoStore.getPluginMgr();
    IPluginInfo userGroupPlugin = pluginMgr.getPluginInfo("CrystalEnterprise.UserGroup");
    // IPluginInfo userGroupPlugin2 = pluginMgr.getPluginInfo("CrystalEnterprise.UserGroup");
    // LOCCreate a new InfoObjects collection._ENDLOC_
    IInfoObjects newInfoObjects1 = infoStore.newInfoObjectCollection();
    IInfoObjects newInfoObjects2 = infoStore.newInfoObjectCollection();
    // LOCAdd the UserGroup interface to the new InfoObjects collection._ENDLOC_
    newInfoObjects1.add(userGroupPlugin);
    newInfoObjects2.add(userGroupPlugin);
    // LOCGet the new UserGroup object from the collection._ENDLOC_
    IInfoObject iObject1 = (IInfoObject) newInfoObjects1.get(0);
    IInfoObject iObject2 = (IInfoObject) newInfoObjects2.get(0);
    // LOCOnce you have the new UserGroup object, set its properties._ENDLOC_
    iObject1.setTitle ("Single Home Group");
    iObject1.setDescription ("It is Single Home Group");
    iObject2.setTitle ("Multi home Group");
    iObject2.setDescription ("It is multi Home Group");
    // LOCRetrieve the ID of the InfoObject (user group)._ENDLOC_
    // objectID = iObject.getID();
    // LOCSave the new group to the CMS._ENDLOC_
    infoStore.commit (newInfoObjects1);
    infoStore.commit (newInfoObjects2);
    catch(Exception ex)
    // If the User group is already created.
    out.println("<SCRIPT language=\"javascript\"> " +
    " alert (\"Sorry - The User Group is already created Please enter another User Group." +
    "\");</SCRIPT>");
    out.println("<META HTTP-EQUIV='refresh' CONTENT='0;URL=LogonPage.jsp'>");
    return;
    // If the User is Logged on the Business objects
    out.println("<SCRIPT language=\"javascript\"> " +
    " alert (\"UserGroup get created in CMS.\"); </SCRIPT>");
    out.println("<META HTTP-EQUIV='refresh' CONTENT='0;URL=LogOff.jsp'>");
    out.close();
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    // </editor-fold>
    when I paste above code in simple notepad as class file and run this file from command prompt
    it gives error like following 1 example I getting 46 errors for different Business Objects classes
    symbol : variable CrystalEnterprise
    location: class GroupCreation
    ISessionMgr sm = CrystalEnterprise.getSessionMgr();
    Please help me Out.
    Thank you.

  • DW CS5 use ActionScript files without Flash

    Our websites must avoid requiring a Flash download in the client browser.
    Can we use Dreamweaver CS5 with ActionScript files (.as) without requiring Flash in a browser?
    For example, DW CS5 menus include File -> New ... -> ActionScript,
    but I cannot find literature or examples on using .as with Dreamweaver.
    thanks,
    Bruce

    ActionScript is the backbone for Flash applications (FLV or SWF).
    Unlike HTML & JavaScript, ActionScript is not a web programming language per se.  It is a Flash programming language.  And while some web devices support Flash many others do not.
    If your site cannot use Flash then your ActionScript will need to be replaced with a suitable web alternative.  Perhaps jQuery or Ajax (JavaScript & CSS).
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • FCE for Slide Shows - Can Import Image Files Without iPhoto, iMovie?

    From posts and the manual it sounds like yes, you can import files (of the right type, such as TIFF or JPEG, and even Photoshop with layers) directly into a project in FCE. Is that so? No need to have them in iPhoto or iMovie or somewhere?
    Thanks,
    Rich
    Context (repeated for a number of questions about FCE I'm asking separately): Trying to escape the Windoze world where I've been using ProShow Gold to make still images (and video) slideshows somewhat easily, I'm thinking I'll be fine with the "more work" to build slideshows in FCE, and would enjoy using the increased power of the program eventually for working more with video. Already hip to the Tom Wolsky posts and links that look great for how to preprocess still images via Photoshop to ready them for FCE, along with lots of other info. Also have looked at all the free Apple web tutorials, as well as the FCE 4 Manual.

    Thank you. I've kind of been thinking that I'd use the info found at http://www.fcpbook.com/Photoshop1.html and hopefully with a batch type process precondition all the images so they'd be more video-ready. But before I do much I'll experiment with just bringing in the full-sized, straight out of the camera image and how it looks after applying the De-interface filter.

  • Watermark using image file name

    Is it possible to use the image filename as the watermark?
    I'd like to export slideshows and contact sheets with the filename watermarked on the image itself.
    If there is a way I'd appreciate some help.
    Thanks,
    Andrew

    Methodphoto man. You really aught to do your post from a WEb browser, not RSS or newsgroup or whatever. SO often your edits still show up as strikeouts. Somethime it might bee something you really don't want read!
    Don
    Don Ricklin, MacBook 1.83Ghz Duo 2 Core, Pentax *ist D
    http://donricklin.blogspot.com/

  • Can't use import javax.swing.RowFilter; in javafx

    Dear all,
    I'm a question for you.
    I developed a javafx application in which I use also swing dialog and swingx libraries.
    The question is I can't use jtable filter of java jdf 1.6
    That is when I try to add in my netbeans javafx project
    import javax.swing.RowFilter;
    it says me it's not correct library
    If I create a java swing application I can add this include.
    Why it?
    I edited netbeans conf to set javafx sdk to javafx lib I downloaded (whole sdk), not that one with netbeans, but nothing.
    It seems like I can't use this import in javafx application.
    Is it posbbile?
    Please help me

    The reason you cannot use it is because javax.swing.RowFilter was introduced in Java 1.6 . Netbeans compiles JavaFX to work with Java 1.5, which does not have the class in question.
    I have gotten around this by going to the properties->Libraries->Add JAR/Folder menu and included the jre/lib/rt.jar file from the jre directly into my project.
    Someone else posted a similar solution and more detailed explanation here: http://steveonjava.com/hacking-javafx-10-to-use-java-16-features/

  • How to handle image files used in PDF forms

    With LiveCycle, I've created an interactive form for Help Desk-type requests, and the form works beautifully. I've tested it, and everything works. Show. Hide, Clear fields. And all the other behaviors I added with Action Builder.
    As a final design feature, on my local machine at work, I added a header image (which is in My Documents>My Pictures). I tested locally and uploaded the form to Sharepoint and tested from there, and from what I can remember, the form looked fine. The header was intact. So I kind of assumed the image was embedded somehow.
    So I brought the file home and opened it there, and -- Voila! -- no header image!
    What happened?
    Does the image file need to be uploaded and the path relative to the location of the file? To me, this doesn't seem to be a huge problem. More of an unexpected one. I can probably upload the image to someplace in Sharepoint and then set the image path in the XML.
    But I'd like to hear the experiences of those who have used image files in their LiveCycle forms.
    Message was edited by: ashish gupta. to make the title more descriptive and added some tags.

    In the Object palette make sure Embed Image Data is ticked.

  • Is it safe to back up a disk image file when it's mounted?

    Hi -
    I use some small, encrypted ".sparsebundle" disk image files to keep my diary, banking info, etc., on. When I'm at the computer, I keep them mounted all the time.
    Is it safe to let Time Machine automatically back up the .sparsebundle disk image files, even while they are mounted? Or would there be a possibility the backups would be corrupted, if the operating system hadn't written out cached data or something to the disk image file?
    In other words, if I save any open documents on the mounted disk image, does the disk image file on disk always contain the fully-saved document and a consistent file system? Or could there still be some data cached in RAM, that would not be saved at the time the .sparsebundle file was copied? Is it always necessary to unmount a disk image before duplicating its .sparsebundle file?
    Do I need to turn off Time Machine's automatic backup, and just do manual "backup now" after unmounting the disk images? That's a major pain in the behind... I really want to just let Time Machine do it's hourly backups as usual, but of course there's no point if the backups are corrupt.
    Of course my own guess is "to be safe", I should unmount them before backing up. But again it's a big pain if it's not actually necessary. Does anyone know for sure?
    Thanks...

    My understanding is that Unix, generally, doesn't write everything out to disk immediately. There is caching in RAM to speed up disk access, including modified superblocks, modified inodes, and delayed reads and writes. Now, if you ask to read an individual file, the kernel makes sure all the cached data is written before it returns the read data. But if you try to do, for example, a block copy of the whole filesystem, the kernel doesn't know that, and there's no guarantee or expectation that the filesystem will be in a coherent state.
    That's the purpose, for example, of the "sync" command - to write all this cached data to disk before unmounting, shutting down, etc., and, that's why the OS gets so upset if you just unplug a firewire drive. Because even if you've saved and closed any open documents, they haven't necessarily been fully written out to disk yet.
    So what I don't understand, is how people are ever able to back up mounted disk image files without them getting corrupted. I mean, you'd think they would get corrupted all the time. It would be the equivalent of just unplugging your firewire drive before you made a backup of it, or of doing a block copy of a read/write mounted filesystem. There ought to be a very good chance of the filesystem being scrambled. So, why does it not happen?
    Is there something different about the Apple filesystem, or Apple disk images? Or, maybe we're only talking about delay times in the cache of fractions of a second, so as long as you haven't written anything within a few seconds of the copy, and don't write anything during it, you're ok?
    Even if Apple reps won't answer my question, the kernel and most likely all the low-level disk i/o and filesystem stuff is open source. Surely there's someone out there who would be knowledgeable enough to give a definitive answer? I was hoping to find someone like that here... I do appreciate your taking the time to answer my post, but maybe I need to go elsewhere, on some developers' mailing lists or something? Does anyone know of such a place I could start looking?
    Thanks...

  • Renaming image files

    I'm using iWeb 1.1.2 If I click on the metrics tab under "Inspector", it will list the name of any image file I select. Is there any way to change the name of an image file without removing it from iWeb, changing it, then re-inserting it into iWeb?
    Some of my image file names consist of several words and a date. I need to shorten names and eliminate spaces between words or numerals.
    Help would be appreciated.
    LaughingBear

    Hello Old Toad,
    The images are interspersed with text on regular webpages, not in albums or anything fancy.
    Yes, I tried changing names in the Domain files, but that just confused the index.html file, ruining the webpage.
    The URL is bear-viewing-in-alaska.info.
    That site is hosted by Yahoo. My iWeb site was created through iMac and then transferred automatically to Mobile Me.
    Since search engines have great difficulty finding that content, I have been trying to transfer my pages from Mobile Me to Yahoo. But Yahoo cannot read file names that contain spaces or "&" signs, which some of my photos have. So I have been trying to rename the image files.
    Put differently, I'm trying to get all of my pages into a single website (rather than 2 inter-linked websites), if not with Yahoo than with some other host that is search-engine-friendly. I initially tried shifting to RAGE, but they were just starting up as a host and did not seem to have their act together yet.
    Given my desire to switch hosts, I have not paid Mobile Me for another year; so the webpages I created on iWeb cannot be viewed there. However, I've managed to transfer a few files to the Yahoo website. You will find them by clicking on "Senior Staff" near the upper right of the homepage, then clicking on "Author." That will lead to a series of images of artwork I've created.
    Look forward to your insights.
    Laughing Bear

  • How can i use my files(apps,media) from my main os to another os in one mac?

    When yosemite was released, i was excited to install it but the problem is that i don't want my main os to be compromised because i think that yosemite is kinda new and it's only 10.0 version and Dota 2 does not work on Yosemite and it's very unstable according to Steam forums and many other sites. My main OSX is still mountain lion and the only os x version that makes dots 2 stable. What i did is I partitioned my hard drive into two one for my main os and one for yosemite. Now i have two os x on my macbook pro. Now the problem is i don't want to install Logic Pro X again and re-download many samples and stuff. When i open the finder in Yosemite, i can see my mountain lion disk where all my files located at? Can i use those files without copying it because my yosemite disk is only 40 gb and my projects and sample audios is 60 gb and open apps from that disk to yosemite? Thanks. Sorry for the long text. I just want to give you the background.

    If you live near an Apple Store, make a Genius Bar appointment to have the computer tested. Supposedly there is no charge for testing. They can also give you an estimate.
    Genius Bar Reservation US

  • Error with list styles using image bullets

    I cannot use list styles with image bullets in the mapping of
    Framemaker documents. If I define and map a format with image
    bullets, then Robohelp creates the correct HTML/CSS code but during
    the Webhelp output forgets to copy the used image files to the
    required locations. It is possible to manually copy the image files
    into the output then the webhelp displays correctly but this is no
    possible process for us on a regular basis.

    Hi
    It's to hard to Mind-Read.
    What did the Error Message say ?
    You are aware of the 99 photos per SlideShow limit in iDVD ?
    I do My SlideShows in
    • iMovie HD6 (or FinalCut) or
    • FotoMagico
    as there are less limit's here
    Yours Bengt W

  • Reuse image file from another DC

    Hi everyone,
    Is it possible to re-use image file stored in the mimes folder of a component in a DC from another DC ?  If it is possible, how do we access the image?
    Thanks,
    Johannes

    Hi,
    This is part of the code I use here in one Project.
      public java.lang.String getBitmapURLByIconId( java.lang.String iconId, java.util.Map iconMap )
        //@@begin getBitmapURLByIconId()
        String bitmapByIconId = getBitmapByIconId(iconId, iconMap);
        if (null == bitmapByIconId) // Not a Valid Icon..
             return "";
        WDDeployableObjectPart deployableObjectPart = wdComponentAPI.getDeployableObjectPart();
        try {
              IWDWebResource webResource = WDWebResource.getWebResource(deployableObjectPart, WDWebResourceType.PNG, bitmapByIconId);
              return webResource.getAbsoluteURL();
        catch (Exception ex) {
             wdComponentAPI.getMessageManager().reportException("Error Loading Icon '" + bitmapByIconId + "', " + ex.getMessage(), true);
             return "";
        //@@end
    In particular, we drive some configuration for Icons / Tooltips from the back-end. The variable "bitmapByIconId" will be populated with whatever Icon name I want to get. What you should look at is basically the IWDWebResource part, don't bother with the rest of the code..
    This is part of a DC and I expose some methods in its Interface Controller so I can re-use the same pictures everywhere.
    Hope it helps,
    Daniel

Maybe you are looking for

  • Adobe photoshop lightroom 4.pkg trying to open with text edit -- how do i open as application?

    downloaded trial for mac, all requirements are met, but cannot get download to open as an application, mac is trying to open with text edit; downloaded several times, every time the disk utility opens

  • BPM -NO interface detected

    Hi,   I am doing one BPM scenario. In Integration Process - Receiver step - Messages .. When I am selecting the messasges, In that Pop up windown no <b>messages Interfaces</b> r coming, even I created Message interfaces. Thx, Ansar.

  • Question related to enhanced interface determination option in ID

    HI All, I am trying to create a 1:N message mapping and here are the steps which I have done. 1. Created a Source Data type, Message type , Message Interface and activated 2. Created 3 Target Data types, 3 Message types and 3 Message interfaces and a

  • In last 2 days, firefox will not open with Onspeed enabled

    In last 2 days Firefox 3.6.6 reports that it cannot find its server, when I have Onspeed enabled. If I disable Onspeed, no problem. I have not messed with either recently. I use Windows Vista and have Adobe and Java plugins installed. == This happene

  • Portal Drive Cache

    Hi All, I have a question about the portal drive cache. Portal Drive is a web dav client to connect to your portal content with the windows explorer. My problem ist that Portal Drive stores cached data on the c:\-drive, in my environment it is C:\Doc