Get JComponent as Image

Hi,
I'm trying to get an Image of a JComponent. I have a JTextArea, but I want to perform a few special effects to it which require that it be converted to an Image.
Is there anyway to get a JComponent as an Image?

That depends. Do you want to keep the text area as a working text area that you want to draw on? If so, subclass JTextArea and override the paintComponent method to do drawing on it.
If you just wanted, say, a screen shot, then you could use the java.awt.Robot class which has a screen capture method. You'd need the bounds of the field translated to screen coordinates (I believe SwingUtilities or Toolkit has a method for that). Or you could create a BufferedImage object and get it's graphics object and call the component's paint method directly passing that graphics object to it.

Similar Messages

  • I cannot add a Wi-Fi guest network. Gone to Utilities Airport Utilities and all get is an image/browser of my Airport Extreme. Looking for the browser which has the title Wireless but cannot find anywhere. I need help?

    I cannot add a Wi-Fi guest network. Gone to Utilities>Airport Utilities and all I get is an image/browser of my Airport Extreme. Looking for the browser window which has the title Wireless but cannot find anywhere. What am I doing wrong?

    Open AirPort Utility. The first screen looks something like this:
    Click on the AirPort Extreme and another screen will appear. Click Edit, then the window with the Wireless tab will appear.
    If you do not see these screens, you will need to start over and configure your AirPort again.

  • How can I use applet to get the desktop image of client

    hi,I have a question to ask u.
    How can I use applet to get the desktop image of client? Now I develop a web application and want user in the client to get his current image of the screen.And then save as a picture of jpeg format ,then upload it to the server?
    I have done an application to get the screen image and do upload file to server in a servlet with the http protocal.

    Since the desktop image is on the client's local hard drive, you'll need to look at trusted applets first.

  • How do I use Adobe Edge to get faded header images on my website?

    Trying to use Adobe Edge to get faded header images on my website. Was referred to Adobe Edge because it is supposed to be easy for beginners. I was able to upload my images, but then there was no instruction/direction on what to do next. Everything I clicked just brought me somewhere else. I'm a novice who needs help with coding, as everytime I tried adding coding to my page, it messed it up. I would appreciate if someone can tell me what to do after I upload the images.

    Yes, Animate. Again, I uploaded the images, but then, I didn't see any directions on what to do next, as I would like fading header images for my website. I understand that it is supposed to generate the code for my website, which is where I need the most help.

  • How do I get a "transfer images" button to show up in the solution center?

    How do I get a "transfer images" button to show up in the solution center for my officejet 6500 709a on XP?
    Scan buttons are displayed and work, as does print.

    What installing the twain plug-in, you mean? Go to your applications folder. Find the Adobe Photoshop Elements 11 folder. Look in there for a folder called support files, then for a folder called optional plugins. In the Optional Plugins folder, there should be a folder called ImportModules. Just drag that from the Optional Plugins folder to the regular Plugins folder.
    This will be infinitely easier to do if you put your applications folder window into list view, not the default icon view. To do that, click this button at the top of the window:

  • How to get a .tif image with n different colors?

    Hi..i want to know how can i get a .tif image colored by some colors. I want to do something like this:
    if(tifImage.pixel < 0.1) {
    tifImage.pixel = yellow;
    else if( 0.1 <= tifImage.pixel && tifImage.pixel <0.5){
    tifImage.pixel = red;
    up to n colors.
    I prove the next code, but it is not getting the colors i want.
    public void generateImage(BufferedImage bi,double alto,double medio,String output){
              int width = bi.getWidth(); // Dimensions of the image
              int height = bi.getHeight();
              // Some constant colors (as arrays of integers).
              int[] red = {255, 0, 0};
              int[] green = {  0,255,  0};
              //int[] blue = {  0,  0,255};
              int[] yellow = {255,255, 0};
              //int[] background = { 85, 85, 85};
              int[] background = { 255, 255, 255};
              // The original image data will be stored on this array.
              int[][][] imageData = new int[width][height][3];
              // We'll fill the array with a test pattern bars thingie.
              double[] pixelArray=null;
              for(int w=0;w<width;w++)
                   for(int h=0;h<height;h++)
                        if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=9000){
                             //lo dejo blanco
                             imageData[w][h] = background;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=alto){
                             //lo dejo rojo
                             imageData[w][h] = red;
                        else if(bi.getRaster().getPixel(w,h,pixelArray)[0]>=medio){
                             //lo dejo amarillo
                             imageData[w][h] = yellow;
                        else{
                             //lo dejo verde
                             imageData[w][h] = green;
              // Now we have a color image in a three-dimensional array, where the
              // third dimension corresponds to the RGB components.
              // Convert the color image to a single array. First we allocate the
              // array.
              // Note that this array will have the pixel values composed on it, i.e.
              // each R,G and B components will yield a single int value.
              byte[] imageDataSingleArray = new byte[width*height*3];
              int count = 0;
              // It is important to have the height/width order here !
              for(int h=0;h<height;h++)
                   for(int w=0;w<width;w++)
                        // Rearrange the data in a single array. Note we revert RGB, I still don't
                        // know why.
                        imageDataSingleArray[count+0] = (byte)imageData[w][h][2];
                        imageDataSingleArray[count+1] = (byte)imageData[w][h][1];
                        imageDataSingleArray[count+2] = (byte)imageData[w][h][0];
                        count += 3;
              // Create a Data Buffer from the values on the single image array.
              DataBufferByte dbuffer = new DataBufferByte(imageDataSingleArray,width*height*3);
              // Create an pixel interleaved data sample model.
              SampleModel sampleModel =
                   RasterFactory.
                   createPixelInterleavedSampleModel(DataBuffer.TYPE_BYTE,
                             width,height,3);
              // Create a compatible ColorModel.
              ColorModel colorModel = PlanarImage.createColorModel(sampleModel);
              // Create a WritableRaster.
              WritableRaster raster = RasterFactory.createWritableRaster(sampleModel,dbuffer,new Point(0,0));
              // Create a TiledImage using the SampleModel.
              TiledImage tiledImage = new TiledImage(0,0,width,height,0,0,sampleModel,colorModel);
              // Set the data of the tiled image to be the raster.
              tiledImage.setData(raster);
              // Save the image on a file.
              JAI.create("filestore",tiledImage,output,"TIFF");
    Thanks

    I tried that. When I open one image and set the exposure, then go to open the second image, nothing happens. I then saved one image as a psd file, then it would let me open the raw file a second time. When I had both open on the same screen and dragged the layer from one into another image, the layer size ended up being different than the other file. It was shifted down and to the left. I need these images to be pixel locked, and the user experience I went through did not allow me to do this.
    I also do not see a way to copy/paste layers between files.

  • How can you get a mirror image of a photo on iPhoto?

    How can you get a mirror image of a photo on iPhoto?

    By using an external editor. Preview is already on your Mac. It's called 'Flip Horizontal'
    In order of price here are some other suggestions:
    Seashore (free)
    The Gimp (free)
    Graphic Coverter ($45 approx)
    Acorn ($50 approx)
    Pixelmator ($50 approx)
    Photoshop Elements ($75 approx)
    There are many, many other options. Search on MacUpdate or the App Store.
    You can set Photoshop (or any image editor) as an external editor in iPhoto. (Preferences -> General -> Edit Photo: Choose from the Drop Down Menu.) This way, when you double click a pic to edit in iPhoto it will open automatically in Photoshop or your Image Editor, and when you save it it's sent back to iPhoto automatically. This is the only way that edits made in another application will be displayed in iPhoto.

  • How to I get a mirror image of a 3D extrude and Bevel image?

    I created a ribbon using the extrude and bevel effect and then mapping it with a custom symbol. I copied the image and then tried to get a matching image on the flipside to mirror it but cannot seem to figure it out. Is there a way to somehow flip the orientation of the image? I tried using transform and then reflect and it does not do anything. I tried to do it manually in mapping and flipping the box upside down and in reverse but it just doesn't seem result in the a reflective image. Any ideas on this? Attached are the two images I am trying to get to reflect each other. Thanks

    It works so it is you who have perhaps a blind spot you have to select reflect X and move the object horizontally just look at my settings and the video.
    If you do not see a difference than what I have done and what Scott has suggested than what you actually did then he problem is something entirely different.
    Here is a video you can go wrong if you follow it.
    http://www.wadezimmerman.com/videos/TransformReflex.mov

  • How to get the full image directory when i upload the image to web page???

    hai, how to get the full image directory when i upload the image to web page???
    here is the example:
    <form action="uploadfile.jsp" method="post">
    image<input type="file" name="image" />
    <input type="submit" value="submit"/>
    <%
    String s=request.getParameter("image");
    %>
    <%=s%>
    </form>
    i upload the image from C:\image\center.gif. i use request.getParameter just can get the image name like "center.gif". Can anybody help me how to get the full path name. Thanks a lot..

    There is no need to get the path. It is also fairly pointless as the server cannot access the client's local file system.
    Carefully read this article how you can upload files the right way: http://balusc.blogspot.com/2007/11/multipartfilter.html

  • In Preview, I suddenly am unable to get the "Adjust Color" tool panel to edit images. I just get the rectangular image selection tool instead. How do I ge the "Adjust Color" tool panel back?

    In Preview, I suddenly am unable to get the "Adjust Color" tool panel to edit images. I just get the rectangular image selection tool instead. How do I ge the "Adjust Color" tool panel back?

    Hmmm, I wonder if that window is hidden or off screen? Have you moved the pic window around to look under it?
    Might try this...
    Safe Boot , (holding Shift key down at bootup), use Disk Utility from there to Repair Permissions.
    Then move these files to the Desktop for now...
    /Users/YourUserName/Library/Preferences/com.apple.finder.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.desktop.plist
    /Users/YourUserName/Library/Preferences/com.apple.recentitems.plist
    /Users/YourUserName/Library/Preferences/com.apple.Preview.plist
    /Users/YourUserName/Library/Preferences/com.apple.Preview.bookmarks.plist
    Reboot & test.
    PS. Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.

  • Why do I get Media Type "image/ipeg" when uploading a PDF?

    I am getting this strange "image/ipeg" media type when uploading with FF (33.0.2 on Mac OS X 10.9.4), instead of "application/pdf." Viewing the request sent using Developer Tools, I get the following headers:
    Content-Disposition: form-data; name="test"; filename="test.pdf"
    Content-Type: image/ipeg
    Looking at mimeTypes.rdf in my that profile, I see
    <RDF:Description RDF:about="urn:mimetype:image/ipeg"
    NC:value="image/ipeg"
    NC:editable="true"
    NC:fileExtensions="pdf"
    NC:description="Document">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:image/ipeg"/>
    When creating a new profile and uploading a PDF, I correctly get "application/pdf", and sure enough, mimeTypes.rdf states:
    <RDF:Description RDF:about="urn:mimetype:application/pdf"
    NC:value="application/pdf">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/pdf"/>
    </RDF:Description>
    I have disabled all Add-ons to see if any of them was causing this, but no luck. I suspect it's either some add-on or OS app association (like OS X Preview) that's causing this, but I can't find the culprit.
    Has anybody ever encountered this? It's very straightforward to fix, but I would like to understand exactly what is going on because it sounds somewhat wrong to send "image/ipeg" as the Media Type for PDF.

    One way that odd content types can be added to the mimeTypes.rdf file is when you are presented with the download dialog (Open/Save/Cancel) for a novel content type and you associate it with a known application. But tracking down the exact site that caused this (assuming it was a misconfigured server) could be impossible.
    On Windows, bizarre things also could be incorporated from the Windows registry, but I don't know whether there is anything equivalent on Mac.

  • How to Get Windows 10 Image for Galileo

    I purchased a Galileo gen 2 board and would like to start prototyping a project I have in mind -- but I cannot for the life of me figure out how/where to get a Win10 image for the board.  I've signed up (twice) through the 'Connect' web site (and gotten
    zero replies), and the links on the Connect site that talk about getting an image if you bought your board yourself just lead to a 404 error.
    Any suggestions?

    Figured this out.
    sign up/join
    MICROSOFT WINDOWS FOR WINDOWS DEVELOPER PROGRAM FOR IOT EULA
    Under
    Windows Embedded Pre-Release Programs Home / Programs Windows Developer Program for IoT
    once you've joined and click on link below, you will see the downloadable link to get 170mb  9600.16384.x86fre.winblue_rtm_iotbuild.150309-0310_galileo_v2.wim  - this file under EULA cannot be shared.
    Hope this helps someone else.
    Go create something using IoT!

  • AP802-BOOT-M bootloader mode and trying to get a new image on there

    Ok. Dont ask me how I managed to get myself in this state. Surfice to say I was trying to upgrade an IOS image on an integrated 887 wireless router and its AP802GN access point.
    The IOS to LWAP conversion did not go well and now I am in the state where I am trying to get the autonomous image back on there.
    so I am faced with either this output.
    *Nov 19 22:14:54.423: %SM_LICENSE-6-BOOTIMAGE_CHANGE_TO_AUTO: Boot image has been changed to autonomous image
    Please use router EXEC CLI service-module wlan-ap 0 reload
    to bootup autonomous image on AP
    Which when executed only brings me back again to the same output.
    I cannot do a show flash:
    it return
    So I thought maybe put it in bootloader mode and copy an image across.
    So I am at the ap: prompt with no understanding as to what to do next as the AP I think has a 10.0.0.1 address and the router it is sitting in has a 192.168.0.1 address.
    I also tried to load a new image when it was in the pr

    I hear what your are saying but it would appear that whilst the software 7.0.235.0 which is on my 2106 WLC does support the AP802 the actual hardware of the 2106 does not.
    I will raise a TAC case tomorrow with Cisco just to make sure but this excerpt from their website is pretty straight forward.
    Cisco 2100 Series Controller
    The Cisco 2100 Series Wireless LAN Controllers work with Cisco lightweight access points and the Cisco Wireless Control System (WCS) to provide system-wide wireless LAN functions. Each controller controls up to 6, 12, or 25 lightweight access points for multiple-controller architectures that are typical of enterprise branch deployments. It may also be used for single controller deployments for small and medium-sized environments.
    Caution Do not connect a Power-over-Ethernet (PoE) cable to the controller's console port. Doing so may damage the controller.
    Note Wait at least 20 seconds before reconnecting an access point to the controller. Otherwise, the controller may fail to detect the device.
    Features Not Supported
    This hardware feature is not supported on Cisco 2100 Series Controllers:
    •Service port (separate out-of-band management 10/100-Mbps Ethernet interface)
    •Cisco 2100 Series Controller does not support the access point AP802.

  • How do i get a scanned image from my canon printer to my macbook

    how do i get a scanned image from my canon printer to my macbook

    The Canon printer can be found in the System Preferences > Print and Fax.Click to reveal the list of printers in the left hand side bar. If your model has scan capabilities then you can click the Open Scanner submenu:

  • How do I get a raw image from "My Pictures" into Photoshop?

    How do I get a RAW image from "My Pictures" into Photoshop? When I send it to Photoshop , it shows up as a grey checkerboard. The title is on the top. Whe I try to send a picture from Camera Raw, it does the same thing.

    Has it ever worked or is this just something that started happening recently?
    Have you tried resetting the photoshop preferences file?
    http://forums.adobe.com/thread/375776?tstart=0
    Have you installed the latest updates for photoshop cs5?
    In photoshop cs5 go to Help>Updates
    To post the system info here on the forum it might depend on your browser, but using firefox as an example, you would open the system info in photoshop, press Copy then OK.
    Here on the forum you would press the ctrl key and paste.

Maybe you are looking for

  • Acrobat Standard 9.1 - Forms Distribution

    I am trying to distribute a form using Acrobat Standard 9.1.  When I try to use either to use the adobe.com or "Save a local copy and manually send it later" option, I am getting this error: "The filename you specified is not valid because it does no

  • T430s and External Monitor & Goto Meeting

    I recently purchased a T430s with the onboard Intel graphics. Here is the problem. The browser window does not function correctly when I run goto meeting. If I switch to the laptop monitor all is fine. Here is what happens: - The screen becomes inact

  • Using built in camera as motion triggered security camera

    I live in an apartment and suspect that some of the staff have come in and have been rooting through some of my files (paper ones) and playing some of my music instruments. Not at all paranoid, things have really been moved around. What reliable soft

  • DataInputStream Limit

    Hello, I am working on a function that is supposed to open file1, read from it, and write data to file2. This is how I am implementing this: File f = new File("/home/me/file1.txt"); File g = new File("/home/me/file2.txt"); String data = "<svg>"; int

  • Error Code: A12E1 on re-install/update

    Hi - I get the error A12E1 when I try to update/reinstall. I have: - Restarted my machine - Uninstall Adobe Application Manager - Deleted everything in Library/Application Support/Adobe/OOBE Please advise. D