Scrolling Around Large, Complex Image

The problem I am trying to solve is straitforward: I will be drawing a complicated graphic out of tens of thousands of individual small lines and circles. This graphic will need to be several thousand pixels wide and tall, so to be able to see all of it I will need to scroll around the image. I have been thrashing for hours trying to figure this out, but I really don't think it should be so complicated. I have posted the unsuccessful code I have so far below, but I am very much open to better approaches that don't use the framework I've laid out here.
Thanks for your help,
- Mark McG.
import java.awt.*;
import javax.swing.*;
public class DrawingTest {
JFrame frame;
Container content_pane;
public static void main(String[] args) {
new DrawingTest();
DrawingTest() {
Container content_pane;
JComponent my_component;
JScrollBar oneJScrollBar;
int frameWidth = 500;
int frameHeight = 500;
frame = new JFrame();
frame.setSize(frameWidth, frameHeight);
content_pane = frame.getContentPane();
oneJScrollBar = new JScrollBar(JScrollBar.HORIZONTAL);
content_pane.add(oneJScrollBar, BorderLayout.NORTH);
my_component = new MyComponent();
content_pane.add(my_component);
frame.setVisible(true);
class MyComponent extends JComponent {
public void paint(Graphics g) {
// Draw an oval bigger than the window
g.drawOval(0, 0, 3000, 2000);
}

I get a feeling that I have been conned! One of my standard demos is not quite what you want but I'm sure you can adapt it
import javax.swing.*;
import java.awt.*;
public class Test060202a extends JFrame
    class TestLabel extends JLabel
        TestLabel(String value)
            super(value, JLabel.CENTER);
            setFont(getFont().deriveFont(24.0f));
    public Test060202a()
        super("Tablet Test");
        JLabel north = new TestLabel("North");
        JLabel south = new TestLabel("South");
        JLabel east = new TestLabel("East");
        JLabel west = new TestLabel("West");
        getContentPane().add(north, BorderLayout.NORTH);
        getContentPane().add(east, BorderLayout.EAST);
        getContentPane().add(south, BorderLayout.SOUTH);
        getContentPane().add(west, BorderLayout.WEST);
        getContentPane().setPreferredSize(new Dimension(512, 512));
        Tablet tablet = new Tablet();       
        JScrollPane scroller = new JScrollPane(tablet);
        getContentPane().add(scroller, BorderLayout.CENTER);
        pack();
    public static void main(String[] args)
        Test060202a tester = new Test060202a();
        tester.setVisible(true);
    class Tablet extends JComponent
        Tablet()
            setPreferredSize(new Dimension(4096, 4096));
            setBackground(Color.cyan);
        public void paintComponent(Graphics g)
            super.paintComponent(g);
            Color savedColor = g.getColor();
            g.setColor(getBackground());
            g.fillRect(0, 0, getWidth(), getHeight());
            g.setColor(savedColor);
            g.setColor(Color.red);
            java.util.Random random = new java.util.Random(1234);
            for (int i = 0; i < 1000; i++)
                g.fillRect(random.nextInt(getWidth()), random.nextInt(getHeight()), 10, 10);
}

Similar Messages

  • Add Scroll Bars around Large JPG Image - JDev 11.1.2

    Hello:
    I have a panel tabbed componet and inside one of the show detail items, I would like to put a rather large image. I can put the af:image into the show detail item, but neither horizontal or vertal scroll bars appear, so I can only see the upper left corner of the JPG image. How can I make horizontal and vertical scroll bars appear around the image?
    Thanks for the help.

    Try to put the image into a panelGroupLayout in scroll mode...
    Timo

  • External monitor flashes when scrolling large Photoshop images

    Hello,
    My external monitor is flashing when I scroll around large Photoshop files. I'm assuming it the graphics processor switching modes. I've got a brand new Macbook Pro 2.66 i7 17" computer and am using a 23" Cinema HD Display (clear bezel) with the Apple ADC to DVI adapter.
    How can I get this to stop?
    Thanks for the help,
    Cyril
    Message was edited by: CyrilW

    According to Apple with an external monitor connected only the nvidia card is used. So it's not changing graphics cards. I would think it's more a driver issue or the usual blinking screen fault of nvidia (timing issue). Send in a report to Apple describing the fault.
    One other thing to check is your cables, from what i gather from your post you have a chain adc-dvi-mdp rattle them, and clean them with spray to take away oxides.
    Message was edited by: pepparkaka

  • How can I scroll around an image if its zoomed out?

    Hey guys, quick one for you.
    I have no problem using the hand tool/spacebar to scroll around an image when zoomed into it, but as soon as I can see the whole thing I can't scroll around anymore and its just locked to the center
    I am a After Effects user so I find this a bit annoying that I can't do this, so I figure there MUST be a setting somewhere I could change to enable it.
    Thanks!

    by Buko wrote:
    Sorry but "How can I scroll around an image if its zoomed out?" has got to be one of the stupidest question I've heard on this forum in some time. Brandon really needs to think before posting.
    I've noticed your usual vitriol toward people having simple questions has ramped up about 200% since the advent of Jive, Buko. Maybe you need to disengage, or neck some holy fermented blue agave juice and take a nap?
    I see the question as perfectly cromulent, and I use the suggestion I've given quite often. Apparently, a good reason why anyone would want to do that has escaped you, and it's made you even crankier than usual. So you react by giving the gift of vile condescension instead of just ShuttingTFU and letting someone else handle it. (Next time you blast Ramon for the same thing, take a look at your own behavior). And apparently, it's not enough for you to just accept that the way someone else wants to work is different than your workdflow, or is something that never even occurred to you. Maybe some folks just want an answer to their question, and secretly wish you'd shove your bad attitude up your [asterisk-substituted name for your lower-dorsal body opening]. Of course, some folks are just too polite, or they're new visitors here and won't say that to you because they don't know the legacy players and behaviors here. But I'm not either of those things, and I will. Because if you can dish it out, surely you can take it, right? RIGHT!?!?
    Now...why do I think the question is worth answering? Sometimes I want to be able to have an entire smallish image visible at 100% magnification in order to view it as it will appear in its final destination. AND I want to do some work on it while keeping all my currently-open Palettes visible; maybe I want to move my image out of the way of a big dialogue box I've called up. (I'm only working on one monitor...sorry if that makes your hardened jaw drop down to your chest).
    In Single-Window made mode I'd have to grab and move the whole window, but I can't do that if I have a big dialogue window open. In full screen mode I can scroll around and see all parts of that image at 100% without having to Tab my palettes to their hidden state, or shove my open dialogue nearly off-screen.
    Think past your own nose, Dude! And LightenTFUp!

  • Slow scrolling after large image loaded

    Hi all,
    Im trying to load a large Jpeg image (11mb, 4096*4096) into a bufferedimage object and draw this on a scrollable panel. However, the load time and scrolling once it has loaded is very slow. Here is the code I use to load the image and draw it
    try {
    File f = new File(mapName_);
    map_ = ImageIO.read(f);
    } catch (Exception e) {}
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    if(map_ != null){
    g.drawImage(map_,0,0,this);
    Also, when I run the program I increase the heap size with the command "java -Xmx128M -jar imap.jar" to avoid out of memory errors.
    Any ideas on how to improve the loading time and scroll speed?
    Thanks

    I have a 9800pro, AMD XP3200 and 1gig pc3200.

  • Draw in a Panel and Scroll around it with the Mouse

    Ok, so I've been bored and needed something to program so I opted with making a single player RPG creator, for this I decided to use a Panel for the screen and then Paint in what I want for maps (importing images using paint) but I want the maps to be bigger
    than the Panel and I want to have the mouse (for now so I can have some understanding of that) scroll around the map, basically have it further than half way down on the panel and it scrolls down, but I don't want any clicking or MouseWheel use needed or used,
    I just want it to follow where the mouse is.
    Long story short, I have a panel, I put the mouse further than halfway, the panel scrolls down or wherever the mouse is pointing.

    Hi,
    Test Tools in Visual Studio 2010 and 2012 forum is to discuss visual studio test issues. Based on your description, your issue seems to be more related to programming. If this is the case, I recommend you to consult your issue on some
    development forums such as Visual Studio Language Forums:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages,
    Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsformsor
    WPF forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpffor better support.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do I place a large format image into Illustrator

    I am trying to place a large format image that I created in Photoshop into Illustrator. I have tried PSD, TIFF, and JPG. I have even cropped down the image into smaller portions to try to make it easier to work with. Every time I try to Place the image I get a dialogue box saying,"The file 'Water 1.jpg' is in an unknown format and cannot be opened.' Can anyone help with this?

    I would guess the file is simply too big.  Make sure the document is in RGB mode.  If I were you, I would never submit a file that size at 300ppi for large format.  Large or grand format printers only need around 100 to 144ppi at 100% final size.  Also, set the Illustrator file up at 25% scale and place the image at 25% @ 300ppi ( image resolution ends up around 75ppi which is still plenty when enlarged 400% to final size ).  Getting back to the original error message, it could be the system is running out of both RAM and scratch disk space and cannot deal with the preview required.  Better to scale the file down for large format.

  • How do you scroll around within your SWF window?

    My Flash document will be 620(w) x 415(h) but I'm going to
    have a background (Photoshop) image that's larger (say twice as
    big). I want to be able to move the cursor to the edges of the
    Flash frame and have the background image scroll in that direction.
    I'm also going to have image maps (hot spots) that can be clicked
    on to pull up additional info. So, my questions:
    1. How do I make the image scrollable?
    2. If my Photoshop image is larger than my Flash document
    size, can I still create clickable areas that fall outside the
    document?
    3. Will the hot spots scroll with the image?
    4. Since I have limited experience with ActionScript...am I
    in over my head?
    Note: I've already imported the (larger) background image
    onto the stage, converted it to a movie clip symbol, gave it an
    instance name of mcMyMovie, and placed hot spots in various areas,
    then I placed it on the 1st frame of my main scene.

    well, a very easy way is to make it, for example, is to
    create 4 boxes (or 8 for the corners) with alpha so they are not
    visible on every side of the visible stage. then you can use some
    event-handler to change the x and y values of your photoshop
    picture when you move the mouse over the boxes.

  • Conversion of large RAW images broken in iOS 7?

    Under iOS 6, I was able to use the camera connection kit to import 36 MP RAW (.NEF) images from my Nikon D800 to my iPad 2, and then open them in Snapseed for quick edits while on the road.  Along came iOS 7 and Snapseed crashes trying to open these files, even after a couple of app updates. (Nik Software, makers of Snapseed, has not offered any info other than "they will see if they can reproduce this"). 
    I've since tried Filterstorn Neue (which also supports RAW images) and it too crashes when opening these large RAW files.
    After importing a smaller, 6 MP RAW .NEF image to the iPad (via Dropbox) I was able to open it fine with both Snapseed and Filterstorm Neue.
    My question: is anyone else having this issue with large RAW images under iOS 7, and have any work-arounds been found?  I'm beginning to suspect that the RAW conversion service of iOS 7 is choking on these images (as opposed to a fault with the photo editting apps themselves), or there is a memory allocation issue.
    Note, I have been successful opening these RAW images with PhotoRaw Lite, but it uses it's own conversion routines, I believe, as well as virtual memory to handle large files.

    Further digging leads me to believe that the issue is that iOS 7 uses more RAM, and on the iPad 2, this doens't leave quite enough memory to open these 36MP RAW images.
    If I close all background apps, I have been able to get Filterstorm Neue to open and edit these RAW images, while having any app still running in the background will cause a crash. No such luck with Snapseed as I'm guessing it uses a bit more memory than Filterstorm. This would account for why PhotoRaw can open and edit these files -  it uses a virtual memory approach to load large files.
    So unless iOS 7 becomes better optimised for RAM usage, or these apps are updated to use virtual memory, looks like I'm limited in which apps can open 36MP RAW images on an iPad 2.  Wonder if a newer retina iPad would manage? They have more RAM I believe, but probably need more to run the display...

  • Large Still Images into PE - One Workflow

    Everyone wants the highest quality that they can obtain when doing their videos. It’s natural to want the best. Well, when dealing with still images, bigger is not necessarily better, for two reasons. First, overly large still images can really tax a system and second, one is limited to the frame size of the video, so these have to be resized somewhere - this resizing can be in the NLE (Non Linear Editor) program, or in an image processing program like PS (Photoshop), which does a better job anyway. Doing this in PS, or PSE, will result in better resized images, and they are easier for the NLE to work with. Quality is as high as your Project’s Preset will allow, and you are more efficient, with fewer crashes, slowdowns and hangs. It is a win-win situation.
    Here is my normal workflow when dealing with still images. This workflow is for NTSC 4:3 720x480 with a PAR (Pixel Aspect Ratio) of 0.9. If your Project’s Presets are different, use those specs to resize to.
    Since I shoot my still images in RAW, I Copy my files from the CF card to my system and catalog these images by location, subject and date (if necessary). I’ll do a quick conversion and Save_As Adobe DNG for backup. I then process these RAW images in PS with the ARC (Adobe Raw Converter), correcting them and then doing a Save_As PSD into a sub-folder. All of this is in my still photo library.
    Normally, I will edit these PSD’s to find the images that I wish to use in a Video Project, and will Copy the selected images to another folder. You’ll see that I work with a lot of Copies, so my original files are always untouched and stored elsewhere. This guards against anything happening to them.
    At this point, I’ll decide how I wish to use these selected images in my Video Project. Let’s just say that they are all horizontal images, and are still full-size from my camera. As stated, my Video Projects are DV-NTSC 4:3 720x480 PAR 0.9. [Remember, your Video Project may vary, so you will need to plug in the dimensions for YOUR Video Project in that case.] I also will have done my Cropping on each image individually, to get them to 4:3 Aspect Ratio. I do this my eye and by hand, rather than via an Action, because I want full aesthetic control.
    In PS, I have a set of Actions for Video. An Action is like a Script, but less powerful and less involved in the writing. As I have already done all of my image enhancements and additional processing before I did my Copy to the selected folder, I only have to worry about my Action resizing these selected images for use in my Video Project. My Action here is to resize to 720x480 with a PAR of 0.9, and I normally use the Action that does this with a particular resizing algorithm, Bicubic-Smoother (though I also use Bicubic-Sharper on occasion).
    For the next step, I go to my folder structure (remember, this folder contains copies of my selected still images in PSD format), and create a new sub-folder "[Project Name]_720x480." Back in PS, I choose File>Automate>Batch. Here I set my Source Folder, my Destination folder and the Action to perform. In my case, it’ll be the Destination Folder, that I just created, [Project Name]_720x480, and my Action will be my NTSC 4:3 720x480 Smooth. I check to have the Open command by-passed, because I do not need to see this take place on my monitor. When I hit OK, PS grabs all files in my Source Folder, runs the commands of my Action and does a Save_As for all files into my Destination Folder. I can process hundreds of large images down to a great 720x480 PAR 0.9 via Bicubic-Smoother interpolation, in moments. Now, I’m ready to go. Last, I Copy my Destination Folder to my Video Project’s folder hierarchy (usually on another HDD), and then Import these processed stills into my NLE.
    What if I need to pan on one, or more of these images, while they are zoomed out completely? I don’t have enough pixels in my horizontal dimension to do this. I am just filling the frame with my still. Well, if I find that there are such images, I go back to my folder with the full sized images in my still images library, and select the ones that need to be larger. I run another Action on these, but it’s one that resizes to something larger than 720x480, say 1000x750. Now, I have another Destination Folder with the name [File Name]_1000x750. I’ll Copy this over to my Video Project, and Import these into the NLE. Here, I can go to Project Panel and remove the 720x480 versions if I so choose, but since a Premiere Project file (.PRPROJ or .PREL) is only an XML database, I may just leave them. It does not contain any media files, just links to where they are on the system and to what operations are performed on them.
    By doing my resizing in PS, rather than in Premiere, I have accomplished two things:
    1.) I have better quality resized images, using the algorithms in PS, plus have a choice of several interpolation methods to work with.
    2.) I have lessened the processing load on my NLE and on my system, while doing the editing
    I get higher quality and lower resource overhead - hence my reference to "win-win."
    Now, back to my aesthetic control. I do not do any automatic zooming or panning. If one allows the NLE to do this, then they will want to probably process all of their images to 1000x750 (remember, this is for an NTSC 4:3 Project, so you will need to calculate what YOUR Project will require).
    The two programs that I use are Photoshop and Premiere Pro, but Photoshop Elements can do the same things, though the exact commands might be different. Premiere Elements will handle the resized still images, just like Premiere Pro and the only difference will be the terminology used when one wishes to Import the still images.
    I also keep all of my images in .PSD (the native format of PS), and do not convert to JPEG, or other. If one’s camera shoots only JPEG, I suggest writing the Action to do the Save_As to .PSD, as another JPEG compression will cost one quality. Yes, the JPEG’s will be smaller, but remember we are looking for the ultimate quality, so larger file sizes are just part of that equation.
    One does not have to deal with all of the Copies, as I do. However, this allows me to go back to the originals, or to the processed full-sized .PSD’s at any step along the way. There is only one thing worse than not being able to go back to an intermediate version with full Layers and Adjustment Layers, plus any Alpha Channels, and that is finding out that you’ve lost your original RAW and DNG backups! That’s why I do a lot of Save_As and also work from Copies all along the way.
    Hunt

    Your workflow looks good. I do similar, but use PS, in lieu of LightRoom. I also do DNG's for my archives.
    Provided that one chooses a JPEG compression algorithm setting that does not do too much compression, I doubt that anyone, but the most very critical, could tell the difference in Video. Most of my tests on PSD vs JPEG have been for print. There, one can more easily detect the differences. Video "hides" some of that.
    To date, I have not had a Project where the Asset size differences between equally sized PSD's vs JPEG's caused any slowdown, or problem. There could be a resources savings with the smaller JPEG files, but there is a tiny bit of overhead dealing with the JPEG compression. I have never tested this, so can only guess that the smaller Asset size of the JPEG would trump that overhead - just a guess on my part.
    For me, keeping the images in PSD does save a tiny bit of work in my Action (basically one less operation to perform), but I doubt that one could measure that time difference, even over the automation of hundreds of images. Besides, it's only one additional line in the Action. My feelings on JPEG vs PSD is firmly based in my print experience, and I am probably being too critical with images going to video. When I move up to HD and BD authoring, I need to apply a very critical eye, to see if I can tell the differences on an HD TV. So long as one does not apply too much JPEG compression, the differences should be very slight, at the worst, and maybe not even noticed, at best.
    I do minimize the impact of many files on my Project by sizing to what I need. If I will not be doing any pans on zoomed-out images, I size to my Project. For pans on zoomed-out images, I calculate just what I will need for those pans, and might end up with several groups of sizes, to accommodate each. Still, the vast majority will be sized to exactly what I need for the Project - very few extra pixels.
    In my case, and yours too, I have my RAW, my DNG, my working Layered PSD's, and then my sized output. I always keep all working PSD's, as I might change my mind, or my client might change theirs, and I do not want to have to go back and redo work, if I still have those working files. I also do as little destructive editing, as I can, using Dupe Layers, and Adjustment Layers, whenever possible. If I can, I never Flatten, or Merge Layers, so I can make any/all changes at any time, and only have to do the resizing via the same Actions. That is basically a "one-button" solution, once I have made the changes required.
    Good luck,
    Hunt

  • How do I export a small section of a large complex illustrator graphic?

    I have a large complex map in an illustrator file and I need to export smaller sections of the map for other uses. When I use artboards, the files still retain ALL of the information. I just want the portion that is on the artboard and I want it as a vector format, so the smaller areas can still be edited.

    Not sure I have enough info to help you, but are a couple suggestions:
    Option 1:
    Select what you want to keep
    Select>Inverse
    Delete
    Save a Copy
    Undo and repeat as needed
    Option 2 (requires Script "MultiExporter"):
    Assemble elements for export on separate Layers/Artboards
    Run MultiExporter Script to export Layers and/or Artboards to separate files (SVG, PNG, etc.)

  • How to import many large graphic images to fit into column width?

    I have a 2-column layout and about 150 large graphic images which must be imported so that they fit exactly into the column width. These are bitmaps which have all the same dimensions. All of them will need a border (stroke). And they should be inline graphics because they belong to exact positions in the text flow.
    What would be the sensible approach to that (apart from scripting which I have not done yet)? I tried to define an object style which has the attribute "Fit content to frame", but this does not scale the image to the column size. How can I avoid to format 150 those images manually?

    It may be easier to change the ppi in photoshop so the image can be placed at the exact size.
    so if the image is 10 inches and the file is 300 ppi
    with resample image unchecked change the width to whatever you want it say 2 inches no the ppi will automatically change to 1500 ppi. Save. If you are creating a PDF make sure these images are not downsampled if you need the resolution.
    another way if all images are the same size would be to size one and place it where all the images go and relink to the other pics, when you relink it should retain the properties of the previous pic.

  • My PDF file appears to be too large/complex to export. Can I split it in some way?

    My PDF file appears to be too large/complex to export. Can I split it in some way?

    Good day Colin,
    In order to split a PDF file, you'll need to use Adobe Acrobat. 
    You may want to try turning off the 'Recognize text' option and converting your file again, it may help.
    Kind regards,
    David

  • Pixel errors when scrolling around

    Hey guys!
    I've got some drawing issues in my app. It seems like my children components are being redrawn just fine when I scroll around, but the background isn't. If I keep the background without color, the error doesn't occur. As soon as I paint it white, it'll look like this when I scroll around: [Here's an example.|http://img3.imageshack.us/img3/4444/pixelerrori.png]
    Any ideas how to fix this assuming I want the performance to be as good as possible?
    Here's my code:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.RenderingHints;
    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.Map;
    import java.awt.geom.Ellipse2D;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    public class LayoutTest extends JComponent{
         private JScrollPane scrollPane;
         private LinkedList<Node> nodes;
         private int rows, cols;
         private static int RADIUS=25;
         LayoutTest(){
              nodes = new LinkedList<Node>();
              nodes.add(new Node(0,0, "a"));
              nodes.add(new Node(0,2, "b"));
              nodes.add(new Node(1,1, "c"));
              nodes.add(new Node(1,3, "d"));
              rows = 1;
              cols = 3;
              this.setLayout(null);
              for(Node node : nodes){
                   this.add(node);
              scrollPane = new JScrollPane(this);
              scrollPane.setBackground(Color.white);
              this.setOpaque(true);
              this.setSize(800,800);
         @Override
         public void doLayout(){
              Map<Point,Point> map = new HashMap<Point,Point>();
              int section_x = getWidth()/(cols+1);
              int section_y = getHeight()/(rows+1);
              if(section_x<section_y){
                   RADIUS = (int) (section_x * 0.3);
              }else{
                   RADIUS = (int) (section_y * 0.3);
              int shift_x = section_x/2-RADIUS;
              int shift_y = section_y/2-RADIUS;
              for(int row=0; row<=rows; row++){
                   for(int col=0; col<=cols; col++){
                        map.put(new Point(row,col), new Point(section_x*col+shift_x,section_y*row+shift_y));
              for(Node node : nodes){
                   node.setRadius(RADIUS);
                   node.setLocation(map.get(node.gridPos));
         @Override
         public Dimension getPreferredSize(){
              return this.getSize();
         public JScrollPane getScrollPane(){
              return scrollPane;
         public static void main(String[] args) {     
              JFrame frame = new JFrame();          
              LayoutTest blub = new LayoutTest();
              frame.setContentPane(blub.getScrollPane());
              frame.setSize(new Dimension(400,400));
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);          
         public class Node extends JComponent {
              public Point coordinates = new Point(0,0);
              public Point gridPos;
              private int radius = 50;
              public String name;
              Node(int col, int row, String name){
                   super();
                   gridPos = new Point(col, row);
                   this.name = name;
              public void setRadius(int radius){          
                   this.radius = radius;
                   this.setSize(new Dimension(radius*2+1,radius*2+1));
              public void paint(Graphics g) {
                   Graphics2D g2 = (Graphics2D)g;
                   Ellipse2D circle = new Ellipse2D.Float();
                   circle.setFrame(new Point(0,0), new Dimension(radius*2,radius*2));
                   g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                   /** draws the node */
                  g2.setColor(Color.green);
                  g2.fill(circle);
                   g2.setColor(Color.black);
                   g2.draw(circle);     
    }For now, I fixed it by overriding the paint() function of the LayoutTest with:
    @Override
         public void paint(Graphics g) {
              super.paint(g);
              g.setColor(Color.WHITE);
              g.fillRect(0, 0, getWidth(), getHeight());
              paintChildren(g);
         }But I kind of have the feeling this is out of the normal drawing order...
    Edited by: my_byte on Jul 5, 2010 5:27 AM

    You are making the JComponent opaque,
    this.setOpaque(true);and not honoring this property. Delete this line of code.
    Also, the scroll pane is a composite component. The "background" you speak of is that of the scroll pane's viewport. So when setting the background I'm pretty sure it should read
    scrollPane.getViewport().setBackground(Color.white);Lastly, when doing swing custom painting you overwrite the paintComponent() method, as opposed to the paint() method.
    public void paintComponent(Graphics g) {
    }Edited by: Maxideon on Jul 5, 2010 1:26 PM
    Also delete your 'fix' to LayoutTest.

  • Scrolling of large amount of data with Unscrolled HEADER .How to do???

    I am in much need of scrolling a large amount of data without scrolling the header,i.e. while scrolling,only data will be scrolled,so that I can see the header as well.I am using JSP in struts framework.Waiting for your help friends.Thanks in advance.

    1) Install Google at your machine.
    2) Open it in your favourite web browser.
    3) Note the input field and the buttons.
    4) Enter smart keywords like "scrollable", "table", "fixed" and "header" in that input field.
    5) Press the first button. You'll get a list of links.
    6) Follow the relevant links and read it thouroughly.

Maybe you are looking for

  • My iPod is cracked and chipped, and the left side does not work, so how am I supposed to get my serial number from my iPod since I cannot unlock it?

    Hello. My iPod was knocked out of my hand at school and it cracked and chipped really bad. It worked fine, until this moning. The entire left side of my screen does not work at all. I cannot rewind songs, unlock my device, or enter my password. How a

  • ONLY ONE RECORD IS DISPLAYED

    hi all..... i executed the smart form and called the FM in program....but only one record is getting displayed....i created a table in main window and put loop in main area... but still only on erecord..please help me.

  • PO Output message schema

    Hi All, I have an issue where the PO output message type is triggering even for the changes made in the PO. It is not defined in the Fine tuned PO for change. After lot of R & D found that the indicator set (N, P) during the assignment of Output sche

  • Grey out Project/WBS number

    Hi, The Project definition/WBSE number in Project Systems is greyed out once the project/WBSE is released. In that case, you could use activity type 45 for authorization objects C_PRPS* or C_PROJ* to provide authorization to change these numbers. But

  • Costing sheet in productin order

    Hi, When we are creting production order system is not taking the costing sheet automatically. But we confiugured all the things properly. We configured order type, cost component structure, costing variant, valuation variant everything. Please guide