Making a BufferedImage to add textfield content to it

Hi guys,
I'm stuck on this problem where I'm trying to create an image to become a bufferedImage so that I can add textfield content to it. At my best approach, I have got the bottom code to be to the best of my knowledge:
if (stack.size() >= 0 ) // keeps drawing to the limit of 10 (set in MainStack)
                   File f = new File("p1.jpg");
                       BufferedImage i = ImageIO.read(f);
                       Graphics g = i.getGraphics();
                       g.drawString(textFieldString, 10, 10);
                   ImageIO.write(i, "jpg", f);
                   g.dispose();
                 //textFieldString1 = textFieldString1 + 1;
                     JLabel content = new JLabel("No. "+Counter+" in stack = "+ textFieldString);
                     content.setIcon(new ImageIcon(getClass().getResource("p1.jpg")));
                     Counter = Counter + 1 ;
                     //pic1.append(textFieldString);
                     // pic1.setIcon(new ImageIcon(getClass().getResource("p1.jpg")));
                    //pic1.drawString(""+textFieldString);
                      Insets insets = displayPanel.getInsets();
                      Dimension size = content.getPreferredSize();
                      content.setBounds(40 + insets.left, stackLayer + insets.top,
                      size.width, size.height);
                      //pic1.setBounds(40 + insets.left, stackLayer + insets.top,
                      //size.width, size.height);
                      displayPanel.setLayout(null);
                      displayPanel.add(content);
                      displayPanel.revalidate();
                      stackLayer = stackLayer - 30;
                  }Which gives me the following errors:
C:\Documents and Settings\Sukhdeep\My Documents\Dissertation\ProjectFiles\Demonstration.java:236: cannot find symbol
symbol  : variable ImageIO
location: class Demonstration
                       BufferedImage i = ImageIO.read(f);
                                                     ^
C:\Documents and Settings\Sukhdeep\My Documents\Dissertation\ProjectFiles\Demonstration.java:240: cannot find symbol
symbol  : variable ImageIO
location: class Demonstration
                   ImageIO.write(i, "jpg", f);
                   ^
2 errors
Tool completed with exit code 1Any help to correct these errors please? I think its something to do with
File f = new File("p1.jpg");But I'm not too sure...

This
test.java:10: cannot find symbol
symbol  : variable ImageIO
location: class Test
        BufferedImage i = ImageIO.read(f);means java cannot find the ImageIO class. You can import it with:
import javax.imageio.ImageIO;

Similar Messages

  • Reg:- Add related content to FR

    Hi All,
    While making a report in FR, When i want to add related content to the cell and after checking the add related content checkbox -> setup, i cant see anything into the "addrelated content" windows that pops up after clicking on Setup.
    Can anyone help me out, how to populate it?
    Regards
    Rajesh Jha

    Hi Ravi,
    Thanks for ur reply. But i have a question where do we have customize option on the Add related content window where in we need to select the content from Available category to related content category?
    Once we click setup after checking the related content checkbox, only option what i get is the window to select the available contents to the related content and this is were i do not find anything in under the AVAILABLE category.
    regards
    Rajesh

  • Can I add html content to a newsstand magazine in InDesign

    I am making a digital magazine that will go onto the App Store and wondered how to add html content. Thanks.

    Moved to DPS...

  • I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts

    I can't synch my iPhone with iTunes because the device does not show up in a device window when I plug it in...it's missing in action and thus I'm not able to add any content from the iTunes to my iPhone, e.g. podcasts.   All the instructions on synching start with "find your device in the device window".  But what if you have no device window?

    Missing "message" from above: The iPad "DGMTR" is synced with another iTunes library on DGMTR's MacBook Pro. Do you want to erase this iPad and sync with this iTunes library? An iPad can be synched with only one iTunes library at a time. Erasing and syncing replaces the contents of this iTunes library.
    I thought the libraries were the same.

  • How can I add new content in iDVD to a DVD-RW disc which has ample remaining free space? After preparing the new video for burning and clicking on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject.

    How can I add new content in iDVD to a DVD-RW disc with a video previously successfully recorded on it? (The disc has ample remaining free space.)
    After preparing the new video for burning and clicking in the File menu on Burn to iDVD, I get a window saying the disc's already recorded and that I can either Erase or Eject. My assumption has been that iDVD would automatically find the free space and continue with the new recording from there. I'd be grateful if anyone can shine light on this.

    There are, but not with a DVD written as a movie disk. It must be closed when completed, or it doesn't work.
    Apple's built in Burn utility also automatically closes any data CD, DVD or Blu-ray disk you burn. Doesn't matter how much space is unused, you can't use it. You'd have to use a more advanced disk creation app, such as Toast Titanium. I then have the option of choosing to write the data as a session:
    I can keep doing this until the disk is full. If I've written five sessions to the disk, when I put it in the drive, five CD/DVD icons will appear on the desktop since the OS will treat each session as if they are separate physical disks. At any point you choose Write Disk when writing a group of data, that means you're closing the disk, and again can't add anything after that. So if I had written two sessions, and the third was Write Disk, it's over. I can't put anything else on that disk.

  • How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles pannel because it's locked.  I would also like to know how I shold tag my cove content.  I dont' want rea

    How should I tag content created in a master page when addressing accessibility before exporting to Acrobat?  I can't add the content to the articles panel because it's locked.  I would also like to know how I should tag my cove content.  I don't want the reader to get lost in content other than the body of the report, but I also don't want to ignore some content completely by tagging it as artifacts.  What should I do y'all?
    Thanks,
    Josh

    Hi Rob,
    From the screen shots it looks like your script is not formatted properly (you may refer to 'Paladin Script' in 'Sample Project' to get an idea of how the script should be formatted.).
    Further please follow the steps mentioned below to use Story to PP workflow.
    Create a new Film script in Adobe Story
    Create  scene heading – INT. LOCATION – Day (these will show up in the outline view panel on left hand side)
    Hit enter, hit TAB
    Enter the name of the speaker, hit TAB or ENTER
    Copy over the transcribed text
    Build your script this way
    Number scenes from the production menu
    Export ASTX file for your script : File->Export->.astx
    Open Premiere Pro
    Create a new project, bring in media
    In the project pane, find the "Scene" column
    For the clip that contains the spoken text, assign the same scene number to the clip as you have in the story script (lets say both are scene 1)
    Click out of the scene box in the project panel in Ppro
    Right click on the scene that you just assigned a scene number to and select – attach Story script
    Select the .astx fle you exported in step 8
    Click ok
    You should now see the script data in the metadata panel for the clip in the metadata panel.
    You can now run speech to text based on "Embedded Script metadata" to time align spoken word to the script.
    Let us know if this is helpful.
    Thanks
    Rashi - Story Team

  • Powershell to add/delete content type to particular library alone in a site collection

    Hi,
    I am trying to add and delete content type from a particular picture library (site collection) using powershell.
    I have tried the below, but it is not working.
    Below scenarios are not working:
    1) If the content type to be added is there in library, then the loop is still moving to "No content type exists".
    2) Content type is not getting deleted from library
    3) Set the newly added content type as default content type.
    Below is the powershell, which I am trying:
    function ChangeContentType($url)
    $site = Get-SPSite($url);
    $web =$site.RootWeb
    $lookForList = "PicLibrary"
    $lookForCT = "Img1ContentType"
    $lookForRemoveCT = "Image2CT"
    write-host "Checking site:"$web.Title
    #Make sure content types are allowed on the list specified
    $docLibrary = $web.Lists[$lookForList]
    if ($docLibrary -ne $null)
    $docLibrary.ContentTypesEnabled = $true
    $docLibrary.Update()
    if (($web.ContentTypes | where { $web.Name -eq $lookForCT }) -eq $null)
    write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
    #Add site content types to the list
    write-host "Adding content type " $lookForCT "on list" $docLibrary.Title
    $ctToAdd = $web.ContentTypes[$lookForCT]
    $ct = $docLibrary.ContentTypes.Add($ctToAdd)
    write-host "Content type" $ct.Name "added to list" $docLibrary.Title
    $docLibrary.Update();
    else
    write-host "content type exists with the name" $lookForCT "on list" $docLibrary.Title
    #Remove Content type
    if (($web.ContentTypes | where { $web.Name -eq $lookForRemoveCT }) -eq $null)
    write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
    else
    $ctToRemove = $web.ContentTypes[$lookForRemoveCT]
    write-host "Removing content type" $ctToRemove.Name "from list" $docLibrary.Title
    $docLibrary.ContentTypes.Delete($ctToRemove.Id)
    $docLibrary.Update()
    else
    write-host "The list" $lookForList "does not exist in site" $web.Title
    #Dispose object
    $site.Dispose()
    $web.Dispose()
    How to fix this?
    Thanks

    Hi,
    Thanks for the reply.
    I checked it. If the script is run multiple times, the add and delete content type will throw error.
    How to delete content type? I have tried the below:
    $docLibrary = $web.Lists[$lookForList]
    if ($docLibrary -ne $null)
    $docLibrary.ContentTypesEnabled = $true
    $docLibrary.Update()
    #get the content Type
    Write-host "Getting content type $lookForCT in site $web"
    #Confirm that the content type exists.
    $contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForCT}
    ##Abort if not found.
    if ($contentType -eq $null)
    Write-host "$lookForCT not found in site collection."
    else
    if ($web.ContentTypes.Name -eq $lookForCT)
    Write-host $docLibrary.ContentTypes.Name
    if($docLibrary.ContentTypes.Name -eq $lookForCT)
    write-host "Content type $lookForCT is already added to list" $docLibrary.Title
    else
    write-host "No content type exists with the name" $lookForCT "on list" $docLibrary.Title
    write-host "Adding Content Type"
    $ctToAdd = $web.ContentTypes[$lookForCT]
    $ct = $docLibrary.ContentTypes.Add($ctToAdd)
    $docLibrary.Update()
    write-host "Content type" $ct.Name "added to list" $docLibrary.Title
    #get the content Type
    Write-host "Getting content type $lookForRemoveCT in site $web"
    #Confirm that the content type exists.
    $contentType = $web.ContentTypes | where {$web.ContentTypes.Name -eq $lookForRemoveCT}
    ##Abort if not found.
    if ($contentType -eq $null)
    Write-host "$lookForRemoveCT not found in site collection."
    else
    if ($web.ContentTypes.Name -eq $lookForRemoveCT)
    Write-host $docLibrary.ContentTypes.Name
    if($docLibrary.ContentTypes.Name -eq $lookForRemoveCT)
    write-host "Content type $lookForRemoveCT is added to list" $docLibrary.Title.
    write-host "Removing Content type $lookForRemoveCT"
    $ctToRemove = $web.ContentTypes[$lookForRemoveCT]
    $docLibrary.ContentTypes.Delete($ctToRemove.Id)
    $docLibrary.Update()
    else
    write-host "No content type exists with the name" $lookForRemoveCT "on list" $docLibrary.Title
    I am getting error in delete now. Error is "Exception calling "Delete" with "1" argument(s): "Specified argument was out of the range of valid values.
    Parameter name: id"
    Thanks

  • Add new Content to a html/plain file

    Hi Everybody,
    how can is it possible to add new content (a new line) to a existing html/plain file? I have two methods, with the first one i can create a file but with the second one it is not possible to add new content to the just created file. What is my mistake?
    Create a file (works!)
    IResourceContext ctx1 = buildResourceContext();     
    RID rid1 = RID.getRID("/SP");     
    final IResourceFactory aResourceFactory = ResourceFactory.getInstance();
    aCollection =(ICollection) aResourceFactory.getResource(rid1, ctx1);
    String out = new String("<h3> Welcome </h3>");     
    filedataStream = new ByteArrayInputStream( out.getBytes() );
    fileContent =
         new Content(
           filedataStream,
           "text/html",
           filedataStream.available());
    if (aCollection != null) {          
         fileResource = aCollection.createResource(
                       "NewFile.html",
                       null,
                       fileContent );
    Add new Conent (doesn't work)
    private void addNewContentToFile(){
    IResourceFactory factory = ResourceFactory.getInstance();               
    IResourceContext ctx = buildResourceContext();                         
    RID rid = RID.getRID("/SP/NewFile.html" );
    IResource resource = factory.getResource(rid,ctx);
    String out = new String("<h3> my New Line </h3>");
    ByteArrayInputStream data = new ByteArrayInputStream(out.getBytes());
    IContent newContent = new Content(data, "html/plain", data.available());
    resource.updateContent( newContent );
    regards,
    Seed
    Edited by: seed_mopo on Oct 28, 2008 10:49 AM

    Sorry, there was an exception (NoCheckOut...) --> Versioning = false.

  • How can I add the content from a iPod Nano to a new iTunes account

    how can I add the content from a iPod Nano to a new iTunes account

    On the computer in iTunes log into her Apple ID and then see if recent purchases are shown by clicking on her name in iTunes, entering her password and then selecting the option. If there is nothing there then she bought that music with a different Apple ID.
    You can use TouchCopy to move all the songs on the iPod to the computer. Then try to play one of the purchase songs and it should show the account used to purchase it and ask for the password.

  • NaN on the run (add cell contents) [CS3, JS]

    Hello.
    This is my first attempt at javascripting ID, though I've done some amount of Applescripting.
    The intent of this script is to add the contents of the table cells that a user has selected.
    I can't figure out why this keeps returning 'NaN' (not a number) after I have told it to ignore any 'NaN' contents (and exclude them from the running total).
    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    var theTotal=0;
    //If the selection is at least one table cell...
    if (app.selection[0].constructor.name == "Cell")
    //count cells in selection
    var cellCount=(app.selection[0].cells.count(0));
    //repeat with count from 1 to count of cells
    for (a=0; a<=cellCount; a++)
    //get contents of first selected cell in the loop
    cellVal=(app.selection[0].contents[a]);
    //convert string to # via parseFloat command
    cellValInteger=parseFloat(cellVal);
    if (cellValInteger!="NaN") //NaN = not a number
    //set the variable to the sum of each cell value
    theTotal+=cellValInteger;}
    else{
    alert("Please fully select at least one table cell and try again.");

    Bob and Dave, many thanks for your help. It works now, and my next challenge is to figure out how to put that data into the last cell.
    Aaron

  • How do I add spoken content in mp3 form to Audiobooks?

    How do I add spoken content in mp3 form to Audiobooks?
    I have tried drop & drag, adding a folder ect.
    It always goes into the music folder. I have unchecked the box in advanced options, as well.
    Thank you any suggestions.
    PB

    See the FAQ at this site.
    http://aldoblog.com/audiobooks/

  • Add file contents using drag drop method

    I want to add file contents to a text view by drag drop method. How i can do that in cocoa using objective c? Can anybody help me. I am using following code in my appCotroller file to do the same but can't get the desired out put. Insted of getting file contents, i m getting the file URL (Path) in the text view.

    shaktirsg wrote:
    As you said i have to open that file in my performDragOperation function, I want to know where to write this function. bcoz i have written this function in my appCotroller class but that code does'n get executed. Can you help me on this.
    It is very hard to debug code I haven't seen. If you are getting the URL in your text view, you must be handling the drag operation correctly. Instead of putting the pasteboard data into the text view, get the file's contents and put that into the text view.
    Also can you give me a sample code on how to open files in coccoa, how to read the contents of that file?
    Look at NSString's "stringWithContentsOfFile:encoding:error:"

  • I can not add any content from my computer to the iPhone through iTunes

    I can not add any content from my computer to the iPhone through iTunes

    syncing itunes windows
    first open itunes on windows computer
    there's a small shaded box in upper left corner click it and show menu bar
    now go under view and show side bar
    go under help and check for updates (11.1.3 current) - update if needed
    plug in iphone (or ipad, ipod ect..)
    when the device shows up in sidebar click on the name of device not the arrow
    this opens up a summary page
    across top says info, apps, music, photos, ect...
    click on what you want to sync ie music
    check the top box that says sync music select -entire library or selected songs and pick what you want by checking
    now apply or sync at bottom
    Peace, Clyde

  • Add 3D Content using script

    Is there a way to script the addition of a 3D model to a pdf using the 3D tool "add 3D content".
    I am trying to semi-automate the addition of 3D models as follows
    User opens existing pdf form (template)
    User starts a script using a button
    Button code selects existing 3D model and brings up the Edit 3D content or add 3D content
    User selects model.
    I guess I don't see the API's for the 3D (model tool) in the reference, only the 3D annotations

    Alastair,
    Javascript intentionally has no File I/O. This is for security purposes. If you want to control the App externally, you can actually do this just fine using Windows Scripting Host and JScript or VBScript. I do this for automation testing all the time. You must create the "File Sytem Object" and "WScript.Shell" in JScript, and then can control Acrobat (or any other App) extensively using "SendKeys".
    This is all probably a bit much, but I was trying to give you a workaround if you reeeeeally wanted to make this happen automatically!

  • Can I add Custom Content Type created programmatically to Custom List Definition?

    I have created Custom content type programmatically in the Feature Receiver. Followed by this have another feature which creates List Template. I want to add the custom content type to the list template.
    Using VS 2012, I added the custom content type to the list definition. The Schema.xml for the list definition looks as below:
    <ContentTypes>
    <ContentTypeRef ID="0x010100D7D9F4B1F4A9684BB44389571024B2EC00C393BB21B8AD7B41B62A87DF0501504D" />
    </ContentTypes>
    ID was automatically added by the VS tool.
    List Template is created, the new content Type is also added, but the Name is displayed as "Document" instead of the custom content type name. So I see two CTs with the name "Document".
    How can I achieve this? Any help is appreciated.

    Hi,
    Please add EnableContentTypes="TRUE" in the <List > tag.
    The following materials would be helpful:
    How to add custom content type to a custom list
    http://innersharepoint.blogspot.de/2009/10/how-to-add-custom-content-type-to.html
    SharePoint Custom List Definition with Content Type
    https://achrafsp.wordpress.com/2013/03/31/sharepoint-list-definition-with-content-type/
    Create a Custom SharePoint List Definition
    http://www.mssharepointtips.com/tip.asp?id=1188
    Best Regards
    Dennis Guo
    TechNet Community Support

Maybe you are looking for

  • Trying to download new version of itunes

    Trying to download the new version of itunes onto my DELL computer & it aburptly stops installing because "proble with the window installer package".  What is that & how do I correct the problem? Deb

  • Mac Media Transfer Error 208

    Hello, I just got an N95 which I have updated to the latest firmware. I have a 2GB SanDisk card inside. I've used the Mac Media Transfer software to browse my device and copy to iPhoto. Things get strange when using the music sync. It's worked on onl

  • About image

    Hi all i write the procedure CREATE OR REPLACE PROCEDURE my_image_display (p_image_id IN NUMBER) AS l_mime VARCHAR2 (255); l_length NUMBER; l_file_name VARCHAR2 (2000); lob_loc BLOB; BEGIN SELECT mime_type, blob_content, filename, DBMS_LOB.getlength

  • Problem accessing database from JApplet

    Hi all, I am having trouble in changing my application to Japplet. It displaying the frame in web page but when i am trying to access database it is not displaying anything. Please let me know if any one know the solution. Thank you. bestpro.

  • Syndicated file name

    Hi, Could anyone give an example of syndicated file naming convention. Sonali