Repaint() in java3d?

Hey, is there a methods in java3d who works like repaint() and paintComponent() methods?
I have to draw something after click the button (points in 3D) and i have to repaint screen (first i have only axis on screen). How should I do this?
this is method panel3d where I draw an axis
    JPanel panel3d() {
        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout());
        GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
        Canvas3D canvas = new Canvas3D(config);
        panel.add(canvas);
        universe = new SimpleUniverse(canvas);
        root = new BranchGroup();
        axis();
        universe.addBranchGraph(root);
        universe.getViewingPlatform().setNominalViewingTransform();
        return panel;
    } axis method:
public void axis() {
        Shape3D shape = new Shape3D();
        TransformGroup objTrans = new TransformGroup();
        objTrans.addChild(shape);
            IndexedLineArray axisLines = new IndexedLineArray(18, GeometryArray.COORDINATES | LineArray.COLOR_3, 30);
            axisLines.setCoordinate( 0, new Point3f(-0.3f/10, 0.0f/10, 0.0f/10));
        shape.setGeometry(axisLines);
        root.addChild(objTrans);
}and I want to draw after click that what I have in method showGraph:
public void showGraph() {
        Shape3D shape = new Shape3D();
     PointArray point = new PointArray(2,GeometryArray.COORDINATES);
//for example one point          
        point.setCoordinate(0, new Point3f(1.0f/10, 1.0f/10, 1.0f/10));
        shape.setGeometry(point);
        root.addChild(shape);
    }and the problem is that I don't know how to draw it after clicking. If I add this method to panel3d method then it will be draw at start of this program
I hope that you understand me :)
Thanks in advance for help!
Edited by: thud_Mike on Jun 4, 2008 6:45 AM

crosspost,
reply here >> http://forums.java.sun.com/thread.jsp?thread=301070&forum=21&message=1194027

Similar Messages

  • Java3D Disappearing canvas problem

    I have a Canvas3D embedded in a JPanel, which is embedded in a JTabbedPane. When I resize the application, on average about one time out of six or so, the Canvas3D won't repaint properly and I'm left with an empty gray panel.
    The recommended solution to this problem (which hasn't worked for me) is to subclass Canvas3D and override the paint method to call Toolkit.sync().
    I'm using Java 1.5.0_06 and Java3D 1.4 (latest "release" build)
    Here's some sample code to reproduce the problem:
        public static void main(String[] args){
            // Main Application Frame
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // Frame contains one component - a tabbed pane
            JTabbedPane tabbedPane = new JTabbedPane();
            frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);
            // First tab in tabbed pane is blank blue panel
            JPanel bluePanel = new JPanel();
            bluePanel.setBackground(Color.BLUE);
            tabbedPane.add("Blank", bluePanel);
            // Second tab in tabbed pane contains the canvas enclosed in a JPanel
            JPanel panel3D = new JPanel(new BorderLayout());
            Canvas3D canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration()){
                public void paint(Graphics g) {
                    super.paint(g);
                    Toolkit.getDefaultToolkit().sync();
            panel3D.add(canvas3D, BorderLayout.CENTER);
            tabbedPane.add("3D", panel3D);
            // Create a simple universe with a root branch grouop
            SimpleUniverse universe = new SimpleUniverse(canvas3D);
            universe.getViewingPlatform().setNominalViewingTransform();
            BranchGroup bgRoot = new BranchGroup();
            // Create a colored cube that is slightly rotated
            TransformGroup tg = new TransformGroup();
            Transform3D transform = new Transform3D();
            transform.rotY(Math.PI / 8.0d);
            tg.setTransform(transform);
            tg.addChild(new ColorCube(0.2));
            // Place the cube inside the universe and compile
            bgRoot.addChild(tg);
            bgRoot.compile();
            universe.addBranchGraph(bgRoot);
            // Display the frame
            frame.pack();
            frame.setSize(500,500);
            frame.setVisible(true);
        }

    After experimenting with this for a while, I can confirm this issue happens even if you don't use a JTabbedPane (i.e. you have a Canvas3D inside a JPanel inside a JFrame). Seems to be a race condition of some sort, because the following (ugly) piece of code will solve the problem (for now):
            Canvas3D canvas3D = new Canvas3D(SimpleUniverse.getPreferredConfiguration()){
                public void paint(Graphics g) {
                    try {
                        Thread.sleep(100);
                    } catch (Exception e){}
                    super.paint(g);
    //                Toolkit.getDefaultToolkit().sync();
            };    Would really appreciate input from anyone who has experienced a similar problem. Thanks.

  • Threads in java3d

    Hello,
    I have some objects in my Scene. With a Key you can add more of them. What I want is, these Object should be fly around in my Scene, and after a while I remove them from my Scene. And I want to control these Objects with Threads. If the Treads change the Position, how can I update the View, or initiate a repaint?
    Thanks for your help

    You seem to think that you can only run a behaviour once per frameNo, you are offcause right. But I have other achitectual resons to avoid behaviors.
    One of them is that Java3D has lowest thread priority, which I maybe dont want my calculation done with. Otherwise I should do calc in high pri thread then start behavior only for updatting the scenegraph. If I program like that I lose the benefits of Java3D being threadsafe. I think they made Java3D threadsafe because you are allowed to modify the live graph as you like, why else make the efford if Java3D can control all access from behaviors, thats like SwingInvokeLater, right?
    from what I recall the behaviour approach is the recommended oneI don't recall ever having heard this, but then again I have not been using J3D since the start. Maybe you remember right. But even if you do I believe the reason this advice was given is because Java3D was at first supposed to be easy to use, even for entry-level programmers. And it makes sense to protect them from the hazards of multithreading in a sound way.

  • How to repaint a JPanel in bouncing balls game?

    I want to repaint the canvas panel in this bouncing balls game, but i do something wrong i don't know what, and the JPanel doesn't repaint?
    The first class defines a BALL as a THREAD
    If anyone knows how to correct the code please to write....
    package fuck;
    //THE FIRST CLASS
    class CollideBall extends Thread{
        int width, height;
        public static final int diameter=15;
        //coordinates and value of increment
        double x, y, xinc, yinc, coll_x, coll_y;
        boolean collide;
        Color color;
        Rectangle r;
        bold BouncingBalls balls; //A REFERENCE TO SECOND CLASS
        //the constructor
        public CollideBall(int w, int h, int x, int y, double xinc, double yinc, Color c, BouncingBalls balls) {
            width=w;
            height=h;
            this.x=x;
            this.y=y;
            this.xinc=xinc;
            this.yinc=yinc;
            this.balls=balls;
            color=c;
            r=new Rectangle(150,80,130,90);
        public double getCenterX() {return x+diameter/2;}
        public double getCenterY() {return y+diameter/2;}
        public void move() {
            if (collide) {
            x+=xinc;
            y+=yinc;
            //when the ball bumps against a boundary, it bounces off
            //bounce off the obstacle
        public void hit(CollideBall b) {
            if(!collide) {
                coll_x=b.getCenterX();
                coll_y=b.getCenterY();
                collide=true;
        public void paint(Graphics gr) {
            Graphics g = gr;
            g.setColor(color);
            //the coordinates in fillOval have to be int, so we cast
            //explicitly from double to int
            g.fillOval((int)x,(int)y,diameter,diameter);
            g.setColor(Color.white);
            g.drawArc((int)x,(int)y,diameter,diameter,45,180);
            g.setColor(Color.darkGray);
            g.drawArc((int)x,(int)y,diameter,diameter,225,180);
            g.dispose(); ////////
        ///// Here is the buggy code/////
        public void run() {
            while(true) {
                try {Thread.sleep(15);} catch (Exception e) { }
                synchronized(balls)
                    move();
                    balls.repairCollisions(this);
                paint(balls.gBuffer);
                balls.canvas.repaint();
    //THE SECOND CLASS
    public class BouncingBalls extends JFrame{
        public Graphics gBuffer;
        public BufferedImage buffer;
        private Obstacle o;
        private List<CollideBall> balls=new ArrayList();
        private static final int SPEED_MIN = 0;
        private static final int SPEED_MAX = 15;
        private static final int SPEED_INIT = 3;
        private static final int INIT_X = 30;
        private static final int INIT_Y = 30;
        private JSlider slider;
        private ChangeListener listener;
        private MouseListener mlistener;
        private int speedToSet = SPEED_INIT;
        public JPanel canvas;
        private JPanel p;
        public BouncingBalls() {
            super("fuck");
            setSize(800, 600);
            p = new JPanel();
            Container contentPane = getContentPane();
            final BouncingBalls xxxx=this;
            o=new Obstacle(150,80,130,90);
            buffer=new BufferedImage(getSize().width, getSize().height, BufferedImage.TYPE_INT_RGB);
            gBuffer=buffer.getGraphics();
            //JPanel canvas start
            final JPanel canvas = new JPanel() {
                final int w=getSize().width-5;
                final int h=getSize().height-5;
                @Override
                public void update(Graphics g)
                   paintComponent(g);
                @Override
                public void paintComponent(Graphics g) {
                    super.paintComponent(g);
                    gBuffer.setColor(Color.ORANGE);
                    gBuffer.fillRect(0,0,getSize().width,getSize().height);
                    gBuffer.draw3DRect(5,5,getSize().width-10,getSize().height-10,false);
                    //paint the obstacle rectangle
                    o.paint(gBuffer);
                    g.drawImage(buffer,0,0, null);
                    //gBuffer.dispose();
            };//JPanel canvas end
            addWindowListener(new WindowAdapter() {
                @Override
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
            addButton(p, "Start", new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    CollideBall b = new CollideBall(canvas.getSize().width,canvas.getSize().height
                            ,INIT_X,INIT_Y,speedToSet,speedToSet,Color.BLUE,xxxx);
                    balls.add(b);
                    b.start();
            contentPane.add(canvas, "Center");
            contentPane.add(p, "South");
        public void addButton(Container c, String title, ActionListener a) {
            JButton b = new JButton(title);
            c.add(b);
            b.addActionListener(a);
        public boolean collide(CollideBall b1, CollideBall b2) {
            double wx=b1.getCenterX()-b2.getCenterX();
            double wy=b1.getCenterY()-b2.getCenterY();
            //we calculate the distance between the centers two
            //colliding balls (theorem of Pythagoras)
            double distance=Math.sqrt(wx*wx+wy*wy);
            if(distance<b1.diameter)
                return true;
            return false;
        synchronized void repairCollisions(CollideBall a) {
            for (CollideBall x:balls) if (x!=a && collide(x,a)) {
                x.hit(a);
                a.hit(x);
        public static void main(String[] args) {
            JFrame frame = new BouncingBalls();
            frame.setVisible(true);
    }  And when i press start button:
    Exception in thread "Thread-2" java.lang.NullPointerException
    at fuck.CollideBall.run(CollideBall.java:153)
    Exception in thread "Thread-3" java.lang.NullPointerException
    at fuck.CollideBall.run(CollideBall.java:153)
    Exception in thread "Thread-4" java.lang.NullPointerException
    at fuck.CollideBall.run(CollideBall.java:153)
    and line 153 is: balls.canvas.repaint(); in Method run() in First class.
    Please help.

    public RepaintManager manager;
    public BouncingBalls() {
            manager = new RepaintManager();
            manager.addDirtyRegion(canvas, 0, 0,canvas.getSize().width, canvas.getSize().height);
        public void run() {
            while(true) {
                try {Thread.sleep(15);} catch (Exception e) { }
                synchronized(balls)
                    move();
                    balls.repairCollisions(this);
                paint(balls.gBuffer);
                balls.manager.paintDirtyRegions(); //////// line 153
       but when push start:
    Exception in thread "Thread-2" java.lang.IllegalMonitorStateException
    at java.lang.Object.notifyAll(Native Method)
    at fuck.CollideBall.run(CollideBall.java:153)
    Exception in thread "Thread-3" java.lang.IllegalMonitorStateException
    at java.lang.Object.notifyAll(Native Method)
    at fuck.CollideBall.run(CollideBall.java:153)
    i'm newbie with Concurrency and i cant handle this exceptons.
    Is this the right way to do repaint?

  • Java3d speed collapse caused by other java apps running at the same time

    Hi
    I am programming a flightsimulator for some months.
    The current state is online available (all free, no copyrights)
    at http://www.snowraver.org/efcn/efcnsim/index.htm
    especially the sample (source) which shows the
    behaviour which is the reason for my post is here
    http://www.snowraver.org/efcn/efcnsim/page2.htm
    My Problem:
    When I start the sim while two other java programs
    ( one is a server running localhost, one is a client )
    are running, the speed of the flightsim is very slow,
    one frame update takes 3 to 5 seconds.
    ( 3 java.exe's in task list plus 1 which is the IDE )
    When I start the flightsim ALONE, I have 30 to 40 frames per second.
    ( 2 java.exe's in the task list = the flightsim and the IDE -> no prob here )
    That means, the flightsim is about 100 times slower, when
    started while the other two apps are running.
    BUT the other two applications do almost ***NOTHING***, the
    CPU load is 1 or 2 percent.
    Of course they have threads running, but all are waiting
    for a signal - no thread really consumes CPU power.
    Interestingly, when I FIRST start the flightsim and AFTER THIS
    start the two other applications, the flightsim
    holds 30 frames per seconds without problems, even
    though the other applications consume some CPU power
    until they have completely started up.
    Configurations:
    JSDK 1.4.2_1 , 0_2..
    Java3D 1.3.1 OPENGL (The DirectX version crashes with D3D device lost)
    Win2000,XP CPU 800MHz upto 3 GHz
    In my point of view, the java3d thread scheduler makes
    some funny decisions when it starts up, which lead
    to the order dependent behaviour described above.
    My question is, if anyone has some ideas, how I could
    get away from this speed collapse.
    The problem is caused in native code I guess.
    I also could imagine, that it has to do something with
    the order in which one creates, attaches and starts
    the Canvas3D. (? could produce race conditions)
    The flightsim runs in full retained mode. Of course
    the CPU work in the behaviours is rather big, because
    the ROAM triangulation update (..) is done there
    and the triangles are recalculated and passed
    ( all BY_REFERENCE ).
    Or could it have to do something with the memory
    consumption ( when all runs, almost all of
    the 512MB RAM is taken by the three java.exe's ) ?
    Any hints or ideas ?

    :) No, Sun does handle it [lol]
    I just have tested it on my computer at work
    ( 3GHz HP compaq, 1GB Ram and a Intel 82865G Graphics
    Card with 64MB memory, Windows XP )
    and it has worked without problems any way I tried.
    ( Except for xclusive fullscreen mode, but I guess, the administrators
    have deactivated it somehow, so we don't play games at work :)
    I couldn't test it under Linux so far, but I think, this will be less
    problematic than Windows [usually].
    However my current assumption is:
    I totally have forgot the [limited] videocard memory.
    I suppose, Java3D tries to put all triangle data and all
    textures to the videocards memory, so most data processing
    then can be passed to it's graphiccard CPU using
    OpenGL commands.
    Now the flightsim produces a varying amount of (by_reference) triangle data ( a few thousands )
    and has some texture maps for the terrain, the sea and other things,
    plus indexed triangle data for the planes and ships.
    The notebook system, which slows down has an ATI Mobile Radeon card
    with only 32MB RAM onboard, whereas the others have 64MB Ram.
    An additional pointer to that theory is that I can trigger the slowdown by resizing
    the flightsim window, while it is running.
    On the notebook, it holds 30fps, until the window exceeds a size of 962*862 pixels.
    At this size the speed collapses and goes down to 1 frame update every 4 seconds.
    If I make the window a few pixels smaller, the speed of 30fps immediately
    is there again.
    Therefore I guess, some data passed to the graphic cards memory depends
    linearly from the canvas3d's window dimension, and at some limit,
    the graphiccard's memory is too small and Java3D changes it's strategy
    and performs most calculations on the computer's mainmemory,
    which of course is a lot slower.
    I'm not very sure about that, I'm just speculating.
    Next thing I will try is to disable directdraw for the other two applications,
    possibly swing also uses graphicscard memory, when directdraw is enabled.
    The solution seems to be clear anyway: The flightsim must examine the system
    and set some parameters depending on the machine's capabilities.
    Onboard videagraphic ram is one of them. If it's too slow, I start to decrease
    the window size and expect to see a sudden increase of speed, as soon as
    the rendering can be done by the graphicscard CPU. If this never happens,
    I assume no OpenGL accelerator is present on that system. This can be seen as a method
    for finding out the amount of videocard memory on a system by trial and error ..?:)
    Thanks for your tips, Alain.
    I especially have to check out the data sharing class in 1.5.

  • Repaint a JEditorPane after inserting data in the Document

    Hi,
    I have a button that inserts some text in a Document using the method insert(int offset, ElementSpec[] data)After that insert, the View recalculates the heights of the text lines, but they don't get refreshed on the JEditorPane. I have to manually insert a new line to make the JEditorPane get updated with the new line height.
    I have tried using invalidate() and repaint() but nothing happens. Is there another way to refresh the contents of the JEditorPane?
    Thanks!!

    revalidate() didn't work. I still have to press "enter" in any part of the document in order to have the line height changed. The method that recalculates the height of the line is View.getPreferredSpan(int) but it isn't called until I insert a new line by pressing enter.
    I think now it's not a repainting issue, I move the window outside the screen and back again and it still doesn't update. The problem is that getPreferredSpan() is not called when it repaints.
    Thanks for your response. I will try to find out how to have the view's size recalculated when I insert content.

  • How to repaint a portion of a component?

    I am working with JLayeredPane and several overlapping components which I draw a selection rectangle around when the user clicks on a component to indicate that it is "selected". If the user selects another component I need to wipe out the selection rectangle on the previously selected component. I'm not sure what the best approach for this is.
    If the initially selected component was underneath (in a lower layer than) another component, I can't simply repaint it without repainting all of the components that are above it. This seems like it could be too much painting just to remove a selection box. Can someone recommend a good approach for this problem?
    Thanks,
    Jonathan

    Thanks for the response. The components should be on separate layers (added via JLayeredPane.add(JComponent) ) so if the painter takes the layers into account, then there must be something else wrong. Here's a quick demo program of what I'm doing:
    import java.awt.*;
    import java.awt.event.MouseEvent;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class LayerDemo {
         private ControlMouseInputAdapter controlMouseInputAdapter = new ControlMouseInputAdapter();
    private static void createAndShowGUI() {
         LayerDemo layerDemo = new LayerDemo();
    JFrame mainFrame = new JFrame();
    try {
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    } catch (Exception e) {;}
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setSize(400, 400);
    JLayeredPane layeredPane = mainFrame.getLayeredPane();
    layeredPane.add(layerDemo.createColoredLabel("test1", Color.RED, new Point(20, 20)));
    layeredPane.add(layerDemo.createColoredLabel("test2", Color.BLUE, new Point(40, 40)));
    mainFrame.setVisible(true);
    private JLabel createColoredLabel(String text, Color color,
    Point origin) {
    JLabel label = new JLabel();
    label.addMouseListener(controlMouseInputAdapter);
    label.setText(text);
    label.setOpaque(true);
    label.setBackground(color);
    label.setBounds(origin.x, origin.y, 140, 140);
    return label;
    public static void main(String[] args) throws Exception {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {createAndShowGUI();}
    private class ControlMouseInputAdapter extends MouseInputAdapter {
    public void mouseEntered(MouseEvent e) {
    JComponent component = (JComponent) e.getSource();
    component.setBorder(BorderFactory.createLineBorder(Color.black));
    public void mouseExited(MouseEvent e) {
    JComponent component = (JComponent) e.getSource();
    component.setBorder(null);
    }

  • How to repaint a component when it moves?

    Hello, I have an application with many JPanels packed together, and one of them has a picture that I render with the paint() method, using the coordinates of the panel as reference. For example, suppose I were to draw the diagonal:
    Dimension d = getSize();
    int w = d.width;
    int h = d.height;
    g.clearRect(0, 0, w, h);
    g.drawLine(0, 0, d.width - 1, d.height - 1);Now on events of user input, the size of other components may change and I revalidate the root pane. This may move or resize my JPanel where I drew.
    So I thought paint() would automatically be called if the component is moved. But it's not! the JPanel moves around, with the diagonal staying in its old place on the screen (so it is no longer the diagonal of the moved JPanel).
    Why and How to do this properly?      It would not be easy, if the user changes any of the many components, to have to manually keep track of everything else and repaint() everything else on the account that it might move, or have to compute whether it moved and repaint(). Wouldn't I be doing the job of the layout manager then? (I use many nested GridBag Layout managers).
    Thank you for any insight. Mark

    For example:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.Graphics;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    * @version 1.0, 11/13/2008
    * @author Pete
    * Image from Funny Junk website: http://www.funnyjunk.com/funny_pictures/
    public class MovePicPanel
      private static final Dimension PANEL_SIZE = new Dimension(800, 700);
      private JPanel mainPanel = new JPanel();
      private BufferedImage image;
      private JPanel picPanel = new JPanel()
        protected void paintComponent(Graphics g)
          super.paintComponent(g);
          if (image != null)
            //!! here's where I draw my image in the JPanel
            g.drawImage(image, 0, 0, this);
      public MovePicPanel()
        try
          image  = ImageIO.read(new URL("http://newmedia.funnyjunk.com/pictures/bills-in-context.jpg"));
        catch (MalformedURLException e)
          e.printStackTrace();
        catch (IOException e)
          e.printStackTrace();
        if (image != null)
          int width = image.getWidth();
          int height = image.getHeight();
          picPanel.setSize(new Dimension(width, height));
          picPanel.setLocation(0, 0);
        JLabel clickMeLabel = new JLabel("Click me and drag mouse");
        clickMeLabel.setFont(clickMeLabel.getFont().deriveFont(Font.BOLD, 32));
        clickMeLabel.setForeground(Color.red);
        picPanel.add(clickMeLabel);
        MouseAdapter mouseAdapter = new MyMouseAdapter();
        mainPanel.addMouseListener(mouseAdapter);
        mainPanel.addMouseMotionListener(mouseAdapter);
        mainPanel.setPreferredSize(PANEL_SIZE);
        mainPanel.setLayout(null);
        mainPanel.add(picPanel);
      public JComponent getComponent()
        return mainPanel;
      private class MyMouseAdapter extends MouseAdapter
        @Override
        public void mousePressed(MouseEvent e)
          picPanel.setLocation(e.getPoint());
        @Override
        public void mouseDragged(MouseEvent e)
          picPanel.setLocation(e.getPoint());
      private static void createAndShowUI()
        JFrame frame = new JFrame("MovePicPanel");
        frame.getContentPane().add(new MovePicPanel().getComponent());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      public static void main(String[] args)
        java.awt.EventQueue.invokeLater(new Runnable()
          public void run()
            createAndShowUI();
    }

  • How to repaint a panel

    Hi All!
    I am trying to display a few textFields in an AWT applet. The number of textFields I need to set is variable. I want to repaint a portion of an applet (the panel in which these textFields are placed) when a button is clicked.
    In the code below, I added a textField array in panel 1(p1), initialized with record size (no_of_rec), which I know at the beginning (no_of_rec = 2 at INDEX = 0).
    When I click "Next Item" button, I want to show 4 textFields (no_of_rec = 4 at INDEX = 1), with the values C, D, E, F.
    One more click (INDEX = 2) should show one textField only, with the value X.
    The codes for the textFields are in a method(addDataPanel), so that I can call it when I click "Next Item" button. A system.out check shows that 4 textFields are created when INDEX = 1, and so on, but with calling repaint() inside the button's actionPerformed method, I am unable to update the panel (p1) dynamically.
    When I minimize the window with [-] button, and get back to the original size, I can see the no of textFields have increased to 6; 2 from the beginning and 4 from the first click.
    Could someone please help?
    Thank you.
    Tienshan
    Here is my code:
    import java.awt.*;                           
    import java.applet.*;                       
    import java.awt.event.*;
    public class test1020 extends Applet{
         int NO_OF_REC = 0;
         int INDEX = 0;
         TextField[] txtDataRowDisplay;
         String[] data;
         Panel p1;
         GridBagConstraints c1;
         Color pnlBgColor = new Color(144, 196, 222);
         public void init() {     
              data = getData(INDEX);
              NO_OF_REC = data.length;
              //main Panel
              Panel pMain = new Panel();
              pMain.setLayout(new GridBagLayout());
              GridBagConstraints c  = new GridBagConstraints();
              pMain.setBackground(pnlBgColor);
              //p0
              Panel p0 = new Panel();
              p0.setLayout(new GridBagLayout());
              GridBagConstraints c0  = new GridBagConstraints();
              c0.fill = GridBagConstraints.HORIZONTAL;
              p0.setBackground(pnlBgColor);
              //p1
              p1 = new Panel();
              p1.setLayout(new GridBagLayout());
              c1  = new GridBagConstraints();
              Button btnNext = new Button("Next Item");
              c0.insets = new Insets(0, 0, 10, 0);
              c0.gridx = 3;
              c0.gridy = 0;
              p0.add(btnNext, c0);
              btnNext.addActionListener(
                   new ActionListener() {
                        public void actionPerformed(ActionEvent e){
                             INDEX++;     
                             data = getData(INDEX);
                             NO_OF_REC = data.length;
                             addDataPanel(p1, c1);
                             display(data);
                             p1.repaint();
              //call a method to add data row(s)
              addDataPanel(p1, c1);
              //add p0 and p1 to pMain;
              c.gridx = 0;
              c.gridy = 0;
              pMain.add(p0, c);
              c.gridx = 0;
              c.gridy = 1;
              pMain.add(p1, c);
              add(pMain);
              this.setBackground(pnlBgColor);
              display(data);
         }//init
         private String[] getData(int index){
              if(index == 0){
                   String[] names = { "A", "B" };
                   return names;
              else if (index==1) {
                   String[] names = { "C", "D", "E", "F" };
                   return names;
              else {
                   String[] names = { "X" };
                   return names;
        private void addDataPanel(Panel p1, GridBagConstraints c1){
              txtDataRowDisplay = new TextField[NO_OF_REC];
              for(int i = 0; i < NO_OF_REC; i++){
                   txtDataRowDisplay[i] = new TextField(4);
              int cnt = 0;
              for(int m = 0; m < txtDataRowDisplay.length; m++ ){
                   c1.gridx = 0;
                   c1.gridy = m + cnt;
                   p1.add(txtDataRowDisplay[m], c1);
                   cnt++;
         private void display(String[] data){
              for(int i = 0; i < data.length; i++){
                   txtDataRowDisplay.setText(data[i]);

    BickelT , yes, it does work! I am almost there, only a small hurdle. When I initialize my textFields with a bigger size, all the smaller sizes are painted correctly. But when the initial size (when index is 0, that is at the time of init) is small, all the subsequent sizes are fixed to that init size.
    For example, when I change my code to the following, it works fine.
    private String[] getData(int index){
              if(index == 0){
                   String[] names = { "C", "D", "E", "F" };
                   return names;
              else if (index==1) {
                   String[] names = { "A", "B" };
                   return names;
              else {
                   String[] names = { "X"};
                   return names;
         } With the code as it is (as posted originally), in the first click, a textField with space(=height) for two textFields is painted with the value C and the lower half is empty. It is refusing to draw the area bigger than the init size of 2. When I resize the applet, I can see that four textFields with the values C, D, E, F.have been painted.
    I added the codes you suggested inside the addActionListner class. Isn't that the correct place to add the codes?
    BTW, with or without p1.repaint, the result is the same.
    What could have gone wrong?
    Thank you.

  • How to repaint a table after a change in data?????????????3F????????

    hi there
    i have a table which contains some values. i am able to delete a row from it. but i need to repaint the table, so that the change can be shown. the table is contained in a scrollPane which is contained in a Pane. i understand that to repaint, i need to call revalidate() or repaint() on a component. in my case, which component should i call the function? or it is done in different way? thank you.
    my code..
    JTable inTable = new JTable(rowDataIn, columName);
    JScrollPane spIn = new JScrollPane(inTable);
    spIn.setPreferredSize(new Dimension(650,270));
    JPanel inPane = new JPanel();
    inPane.add(spIn);
    ..2C270));
    JPanel inPane = new JPanel();
    inPane.add(spIn);
    ..

    After ur modifications done in a JTable, I think u need to call this method.
    fireTableChanged(new TableModelEvent(this)) ;
    Here this is a instance of myModel object which extends AbstractTableModel.
    Hope it helps.

  • How to repaint a table after a change in data?????????????

    hi there
    i have a table which contains some values. i am able to delete a row from it. but i need to repaint the table, so that the change can be shown. the table is contained in a scrollPane which is contained in a Pane. i understand that to repaint, i need to call revalidate() or repaint() on a component. in my case, which component should i call the function? or it is done in different way? thank you.
    my code..
    JTable inTable = new JTable(rowDataIn, columName);
    JScrollPane spIn = new JScrollPane(inTable);
    spIn.setPreferredSize(new Dimension(650,270));
    JPanel inPane = new JPanel();
    inPane.add(spIn);
    ..

    After ur modifications done in a JTable, I think u need to call this method.
    fireTableChanged(new TableModelEvent(this)) ;
    Here this is a instance of myModel object which extends AbstractTableModel.
    Hope it helps.

  • How to repaint a JTextArea inside a JScrollPane

    I am trying to show some messages (during a action event generated process) appending some text into a JTextArea that is inside a JScrollPane, the problem appears when the Scroll starts and the text appended remains hidden until the event is completely dispatched.
    The following code doesnt run correctly.
    ((JTextArea)Destino).append('\n' + Mens);
    Destino.revalidate();
    Destino.paint(Destino.getGraphics());
    I tried also:
    Destino.repaint();
    Thanks a lot in advance

    Correct me if I am wrong but I think you are saying that you are calling a method and the scrollpane won't repaint until the method returns.
    If that is so, you need to use threads in order to achieve the effect you are looking for. Check out the Model-View-Contoller pattern also.

  • How to "repaint" a custom node

    Hi everybody.
    I have working with JavaFX for a short time and a problem has come up... I'm developing an application where I dragg and drop elements from one half of the Scene to the other. Each half is represented by a Custom node that shows some thumbnails. When I dragg an element from one side to the other, I managed to insert that element in the sequence belonging to the destiny (Custom node) side.
    What I want is making this change of position visible, Each side of the Scene has a lot of thumbnails and I use a scroll to browse all the elements. When I transfer a thumbnail from one side of the Scene to the other is still the origin custom node scroll which moves the just transferred thumbnail altought it should be managed by the destiny custom node scroll...
    What I would need is a kind of "repaint" method, like the Swing's one...
    Thank's in advanced. Regards.

    Hi Nachy,
      Thanks for your replay,
    Regards,
    Anumaala Kumar

  • Image repaint preformance and threading

    Folks,
    I'm trying to make this sucker run faster.
    My question is, can anyone please guide me, especially with regards synchronising the Threads more efficiently... I'm thinking of using join and i]notify to make the "navigator" threads yield to the swing threads, to give it a chance to repaint before continuing... does this sound sane to you?
    Currently, without the thread.sleep it paints get the first "burst", and then nothing until the alrorithm has completed... exactly not what I wanted, because the whole point of this GUI is to watch the algorithm at work... sort of a "visual debugger"... I find that watching an algorithm play out helps me to "imagineer" ways of improving it... and in this case improvement means optimisation... it's all about getting from A-J faster than anyone else on the planet, especially those smarty-wishbone-legs C# programmers ;-)
    The code is too big to post (darn that 7500 char limit!) so I'll split it over several posts here, and I've also posted it as a single download to [MazeOfBoltonGUI2.java|http://groups.google.com/group/comp_lang_java_exchange/web/MazeOfBoltonGUI2.java] on my google group (comp lang java exchange).
    Cheers all. Keith.
    package forums.maze;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.SortedMap;
    import java.util.TreeMap;
    import java.util.Stack;
    import java.util.Queue;
    import java.util.PriorityQueue;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.concurrent.Callable;
    import java.util.concurrent.ExecutorService;
    import java.util.concurrent.Executors;
    import java.util.concurrent.Future;
    import java.util.concurrent.ExecutionException;
    import java.awt.Dimension;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Font;
    import java.awt.image.BufferedImage;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.SwingWorker;
    import java.io.PrintWriter;
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.io.BufferedReader;
    import java.io.FileReader;
    import java.io.IOException;
    * A Visual debugger,
    * for the [A* Alogorithm|http://en.wikipedia.org/wiki/A*_search_algorithm] navigator
    * of the [Maze Of Bolton|http://cplus.about.com/od/programmingchallenges/a/challenge12.htm]
    * as implemented by [Prometheuz|http://forums.sun.com/profile.jspa?userID=550123]
    * with GUI by [Kajbj|http://forums.sun.com/profile.jspa?userID=91610]
    * hacked together by [Keith Corlett|http://forums.sun.com/profile.jspa?userID=640846]
    * and posted on [Sun's Java Forum|http://forums.sun.com/thread.jspa?threadID=5319334]
    * and posted on [Google news group|http://groups.google.com.au/group/comp_lang_java_exchange/]
    public class MazeOfBoltonGUI2
      static final char[][] matrix = readMatrix("map.txt");
      public static void main(String[] args) {
        SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              try {
                MazeNavigator navigator = new MazeNavigator(matrix);
                JFrame frame = new JFrame("MazeOfBoltonGUI2");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setContentPane(new MainPanel(navigator));
                frame.pack();
                frame.setVisible(true);
              } catch (Exception e) {
                e.printStackTrace();
       * Reads the file into a char matrix[rows,cols] ie: an array of char arrays.
       * @param String filename - the name of the file to read
       * @return a fixed length array of strings containing file contents.
      private static char[][] readMatrix(String filename) {
        try {
          BufferedReader input = null;
          try {
            input = new BufferedReader(new FileReader(filename));
            char[][] matrix = null;
            List<String> lines = new ArrayList<String>();
            String line = null;
            while ( (line = input.readLine()) != null ) {
              lines.add(line);
            int rows = lines.size();
            matrix = new char[rows][];
            for (int i=0; i<rows; i++) {
              matrix[i] = lines.get(i).toCharArray();
            System.err.println("DEBUG: rows="+rows+", cols="+matrix[0].length);
            return matrix;
          } finally {
            if(input!=null)input.close();
        } catch (IOException e) {
          e.printStackTrace();
          throw new IllegalStateException("Failed to readMatrix!", e);
    class MainPanel extends JPanel
      private static final long serialVersionUID = 1L;
      // button panel
      private final JButton goButton;
      // maze panel
      private final MazeNavigator navigator;
      private final Monitor<Path> monitor;
      private BufferedImage background;
      private BufferedImage image;
      private List<Path>currentPaths;
      public MainPanel(MazeNavigator navigator) {
        this.navigator = navigator;
        this.monitor = new SwingMonitor();
        this.goButton = new JButton("Go");
        goButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent event) {
              final String caption = goButton.getText();
              goButton.setVisible(false);
              monitor.execute();
        add(goButton);
        setPreferredSize(new Dimension(navigator.maze.cols*3, navigator.maze.rows*3)); //w,h
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (image==null) {
          image = (BufferedImage)createImage(navigator.maze.cols, navigator.maze.rows);
          mazeColors = createMazeColors(navigator.maze);
        this.draw(image.createGraphics());
        ((Graphics2D)g).drawImage(image, 0, 0, super.getWidth(), super.getHeight(), null);
      private static Color[][] mazeColors;
      private static Color[][] createMazeColors(Maze maze) {
        Color[][] colors = new Color[maze.rows][maze.cols];
        for (int r=0; r<maze.rows; r++) {
          for (int c=0; c<maze.cols; c++) {
            colors[r][c] = getColor(maze.matrix[r][c].ch);
        return colors;
      }*... PTO ...*

    I'm persuaded that the main issue (no intermediate results drawn) is the improper use of SwingWorker.
    When you've got over it, you may want to consider other smaller-effect optimizations:
    Reconsider usage of an offscreen image*
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (image==null) {
          image = (BufferedImage)createImage(navigator.maze.cols, navigator.maze.rows);
          mazeColors = createMazeColors(navigator.maze);
        this.draw(image.createGraphics());
        ((Graphics2D)g).drawImage(image, 0, 0, super.getWidth(), super.getHeight(), null);
      }At first I didn't get why you wanted to draw an offscreen image, then paint it to the screen, all that in the EDT.
    After reading the draw() method more closely, I guess you want to ease the coding of the scaling: you draw an image where one cell = one pixel, then paint the image, scaled to the panel's display size.
    In terms of performance, I don't know how it stands:
    On one hand, the image creation if lighter (1 pixel per cell). And you have a point that the built-in scaling offered by Graphics2D.drawImage(image, size) may be efficient. I can't comment on that, I hope the granphics and hardware acceleration folks will pop in the thread.
    On the other hand, if the built-in scaling had poor performance, it may be good to try what "manual" scaling would bring you. That means, in a simplified version, skip the offscreen image creation, and draw directly on the paintComponent()'s Graphics2D argument. the drawing of a cell at coordinates c,r, for example, would look like:
    g.fillRect(c*CELL_WIDTH, r*CELL_HEIGHT, WIDTH, HEIGHT);Performance apart, the scaling as you do it currently has functional drawbacks, if you want pathes as 1-pixel width lines over large cells:
    - if the maze is smaller (in rows, columns) than the panel displaying it (in pixels), the cells will be scaled but the pathes too: so your 1-pixel lines appear as large as the cells. May or may not be a desired effect.
    - if the maze is larger than the display panel, the cells are shrinked, fine, but the so are the path lines, to a point where they may be invisible (probably depending on color blending, I'm a n00b at graphics operations).
    But maybe I misunderstood the need, and maybe the intended drawing of a path is actually the drawing of the rectangles of all its traversed cells, in special path colors?
    Reconsider intermediate allocations*
    Each paintComponent() call results in the allocation of a 2D-array of Color objects (method createMazeColors(Maze)).
    I don't see what the mazeColors array brings you. I assume you wanted to decouple the determination of colors (depending on cell state) and the rendering of the colors: what does it bring: no performance advantage (on the contrary, it adds a 2D array allocation, and 2xN^2 2D-array access), and does not improve the code readability either (subjective rant, sorry).
    Why don't you pass the Maze as an argument to the draw() method, and call the getColor(cell.ch) from there?
    Side note, maybe a bit subjective: performance apart, the design of the usage of this mazeColor array is a no-go!
    An instance method alters a static variable reference,which is used subsequently in another instance method, with no synchronization. The current code does that in a single thread (+paintxxx()+ is only called in the EDT), which keeps that safe (I'd dare to say: by luck), but considerations exposed below may have you refactor the design to introduce other threads, and may exhibit the thread-unsafety of this design.
    Consider drawing the image in a background thread.*
    Indeed the technique of drawing to an offscreen image is quite common, but it is often done to improve responsiveness (not raw performance) of Swing applications. Here is a resource about this (what the author calls the passive approach), although it doesn't use a background thread.
    The idea is that if a paintCompobnent() methods involves lots of computation (arithmetics of traversing a 2D model, scaling things, etc.), this takes CPU times in the EDT, and all subsequent events (such as, a MouseEvent, but also other painting events) keep pending on the event queue, which is consumed by the single event-dispatch thread. The result is that the UI appear unresponsive, and painting of other areas may seem hung.
    The idea is to move the computation to a background thread, which posts rendering to the EDT when the Image is ready to be displayed.
    Of course this doesn't gain any CPU time. This only ensures the EDT uses a minimal part of this CPU (only render and image and process events), instead of performing the whole computation.
    In your case you already have a background thread, and indeed an appropriate choice, a SwingWorker. The application of this technique would consist in calling the draw() method in the worker thread (in the update(Path) method), and invoke super.publish() only after the image has been updated. Note that the process(List<Path>) could then ignore its argument (you may reconsider the choice of type parameter of the worker), and simply get the latest version of the image attribute).
    Of course in this technique, the offscreen image filling is called synchronously from the Navigator, so this halts the algorithm part itself, for the duration of the image generation. You may refine the technique by spawning a dedicated thread for the image generation - with subtle guard code to handle occasions when the algorithm goes faster than the image generation, and posts a new update(Path) while the image generation for the previous path has not completed yet...
    Recuce the number of things to redraw*
    Two parts:
    first, depending on the number of cells and pathes, there may be (yet another) optimization, to not redraw the whole offscreen image, but only the cells/path that have changed in the last update(). In particular, if a path is not a line but a list of cells, then it's quite easy, reusing the current offscreen image, to only fillRect(...) the appropriate cells.
    Second, if a path is not rendered as a thin line over larger cells, but as cells themselves rendered in special path colors, you may paint cells and path in one go: instead of drawing, first the cells, then the path, draw only the cells, electing the color using a decision method such as:
    private Color getColor(Cell) {
        if (cell.getPathState()!=NOT_IN_ANY_PATH) {
            return getColor(cell.getPathState());
        else {
            return getColor(cell.ch);
    }Of course this forces you to modify your data model, and update the new pathState as part of the algorithm (or better isolated, in the update(Path) method, before invoking the drawing machinery). Maybe that was the intention of the mazeColors array?
    I haven't studied your other posts on the logic of the MazeOfBolton algorithm, so I don't know if it's acceptable for you that a cell appear to have only one path state, as opposed to one for each of the pathes that traverse it. This last trick may then seem incorrect, but please consider it as only a graphical information, and indeed your current image drawing draws only ONE path for a given cell (the last path in currentPaths that traverses this cell ).

  • Repaint Problem in JInternalFrame!!!! help plz.

    hi,
    I have a question I have an application that has internal frames, Basically it is a MDI Application. I am using JDK 1.2.2 and windows 2000. The following example shows that when I drag my JInternalFrames only the border is shown and the contents are not shown as being dragged that's fine, but the application I am running have lot of components in my JInternalFrames. And when I drag the JInternalFrame my contents are not being dragged and that's what I want but when I let go the internalFrame it takes time to repaint all the components in the internalFrame. Is there any way I can make the repaint goes faster after I am done dragging the internalFrame. It takes lot of time to bring up the internalframe and it's components at a new location after dragging. Is there a way to speed up the repainting. The following example just shows how the outline border is shown when you drag the internalFrame. As there are not enough components in the internal frame so shows up quickly. But when there are lots of components specially gif images inside the internalframe it takes time.
    /*************** MDITest ************/
    import javax.swing.*;
    * An application that displays a frame that
    * contains internal frames in an MDI type
    * interface.
    * @author Mike Foley
    public class MDITest extends Object {
    * Application entry point.
    * Create the frame, and display it.
    * @param args Command line parameter. Not used.
    public static void main( String args[] ) {
    try {
    UIManager.setLookAndFeel(
    "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
    } catch( Exception ex ) {
    System.err.println( "Exception: " +
    ex.getLocalizedMessage() );
    JFrame frame = new MDIFrame( "MDI Test" );
    frame.pack();
    frame.setVisible( true );
    } // main
    } // MDITest
    /*********** MDIFrame.java ************/
    import java.awt.*;
    import java.awt.event.*;
    import java.io.Serializable;
    import javax.swing.*;
    import javax.swing.border.*;
    import javax.swing.event.*;
    * A top-level frame. The frame configures itself
    * with a JDesktopPane in its content pane.
    * @author Mike Foley
    public class MDIFrame extends JFrame implements Serializable {
    * The desktop pane in our content pane.
    private JDesktopPane desktopPane;
    * MDIFrame, null constructor.
    public MDIFrame() {
    this( null );
    * MDIFrame, constructor.
    * @param title The title for the frame.
    public MDIFrame( String title ) {
    super( title );
    * Customize the frame for our application.
    protected void frameInit() {
    // Let the super create the panes.
    super.frameInit();
    JMenuBar menuBar = createMenu();
    setJMenuBar( menuBar );
    JToolBar toolBar = createToolBar();
    Container content = getContentPane();
    content.add( toolBar, BorderLayout.NORTH );
    desktopPane = new JDesktopPane();
    desktopPane.putClientProperty("JDesktopPane.dragMode", "outline");
    desktopPane.setPreferredSize( new Dimension( 400, 300 ) );
    content.add( desktopPane, BorderLayout.CENTER );
    } // frameInit
    * Create the menu for the frame.
    * <p>
    * @return The menu for the frame.
    protected JMenuBar createMenu() {
    JMenuBar menuBar = new JMenuBar();
    JMenu file = new JMenu( "File" );
    file.setMnemonic( KeyEvent.VK_F );
    JMenuItem item;
    file.add( new NewInternalFrameAction() );
    // file.add( new ExitAction() );
    menuBar.add( file );
    return( menuBar );
    } // createMenuBar
    * Create the toolbar for this frame.
    * <p>
    * @return The newly created toolbar.
    protected JToolBar createToolBar() {
    final JToolBar toolBar = new JToolBar();
    toolBar.setFloatable( false );
    toolBar.add( new NewInternalFrameAction() );
    // toolBar.add( new ExitAction() );
    return( toolBar );
    * Create an internal frame.
    * A JLabel is added to its content pane for an example
    * of content in the internal frame. However, any
    * JComponent may be used for content.
    * <p>
    * @return The newly created internal frame.
    public JInternalFrame createInternalFrame() {
    JInternalFrame internalFrame =
    new JInternalFrame( "Internal JLabel" );
    internalFrame.getContentPane().add(
    new JLabel( "Internal Frame Content" ) );
    internalFrame.setResizable( true );
    internalFrame.setClosable( true );
    internalFrame.setIconifiable( true );
    internalFrame.setMaximizable( true );
    internalFrame.pack();
    return( internalFrame );
    * An Action that creates a new internal frame and
    * adds it to this frame's desktop pane.
    public class NewInternalFrameAction extends AbstractAction {
    * NewInternalFrameAction, constructor.
    * Set the name and icon for this action.
    public NewInternalFrameAction() {
    super( "New", new ImageIcon( "new.gif" ) );
    * Perform the action, create an internal frame and
    * add it to the desktop pane.
    * <p>
    * @param e The event causing us to be called.
    public void actionPerformed( ActionEvent e ) {
    JInternalFrame internalFrame = createInternalFrame();
    desktopPane.add( internalFrame,
    JLayeredPane.DEFAULT_LAYER );
    } // NewInternalFrameAction
    } // MDIFrame
    I'll really appreciate for any help.
    Thank you

    Hi
    if you fill the ranges
    r_rundate-sign = 'I'.
    r_rundate-option = 'EQ'.
    r_rundate-low = '20080613'.
    r_rundate-high = '20080613'.
    APPEND r_rundate.
    EQ = 'equal', the select check the record with data EQ r_rundate-low.
    change EQ with BT  
    BT = between
    r_rundate-sign = 'I'.
    r_rundate-option = 'BT'.
    r_rundate-low = '20080613'.
    r_rundate-high = '20080613'.
    APPEND r_rundate.
    reward if useful, bye

Maybe you are looking for

  • Recover from Windows 7 back to Vista

    I have installed Windows 7 over my Vista implementation. Now I want to recover to Vista again and want to make use of my recovery partition on the harddisk. However, the Lenovo button in combination with F11 does not work and always logs me on to Win

  • Open file in sample editor

    Hey forum, This is probably a super noob question, but I have a clip of a 7 bar guitar line that I want to open in the sample editor so I can reverse it. I know the default is to double-click it, but it has the arrow on the left side and when I doubl

  • Anyone following the Flash vs. HTML5 debate

    Hey everyone. I have been developing systems in Flex3/4 and AS3 for two and a half fantastic years now. Flex and AS3 have been an absolute pleasure to work with. True OOP support, creating subcomponents a piece of cake, great development tools,  cros

  • HTML in forms

    I want to write HTML in the forms, is this possible???

  • Document keeps getting duplicated every time I save

    I think my preferences have been set up so that every time I make changes to my document I seem to be getting a new copy every time, so that instead of just working on one version, I suddenly have about three or four documents with the same document