How to make line segments persist

I am studying by myself, and I have already Googled the subject line, to no avail.
I am trying to write lines with movement dictated by the arrow keys. I can get a line segment to move, but after the movement the whole panel gets repainted. So I don't get any lines written anywhere.
Anyone have a solution to this?
Here's my code.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DrawLinesUsingKeys extends JFrame {
    private DisplayCoordinatePanelSEVEN keyboardPanel =
            new DisplayCoordinatePanelSEVEN();
    public DrawLinesUsingKeys() {
        getContentPane().add(keyboardPanel);
        keyboardPanel.setFocusable(true);
    /**Main method*/
    public static void main(String[] args) {
        // Create a frame
        DrawLinesUsingKeys frame = new DrawLinesUsingKeys();
        frame.setTitle("Draw Lines Using Keys");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
class DisplayCoordinatePanelSEVEN extends JPanel implements KeyListener {
    private boolean pressedAction = false;
    private int x = 150;
    private int y = 150;
    private int z = 150;
    private int a = 150;
    public DisplayCoordinatePanelSEVEN() {
        addKeyListener(this);
    public void keyPressed(KeyEvent e) {
        pressedAction = true;
        switch (e.getKeyCode()) {
            case KeyEvent.VK_DOWN:
                a = y + 10;
                break;
            case KeyEvent.VK_UP:
                a = y - 10;
                break;
            case KeyEvent.VK_LEFT:
                z = x - 10;
                break;
            case KeyEvent.VK_RIGHT:
                z = x + 10;
        repaint();
    public void keyReleased(KeyEvent e) {
    public void keyTyped(KeyEvent e) {
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.BLACK);
        if (pressedAction) {
            g.drawLine(x, y, z, a);
            pressedAction = false;
            x = z;
            y = a;
    }Thank you for your time.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class DrawLinesUsingKeys extends JFrame {
    private DisplayCoordinatePanelSEVEN keyboardPanel =
            new DisplayCoordinatePanelSEVEN();
    public DrawLinesUsingKeys() {
        getContentPane().add(keyboardPanel);
        keyboardPanel.setFocusable(true);
    public static void main(String[] args) {
        DrawLinesUsingKeys frame = new DrawLinesUsingKeys();
        frame.setTitle("Draw Lines Using Keys");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setSize(300, 300);
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
class DisplayCoordinatePanelSEVEN extends JPanel implements KeyListener {
    java.util.List<Point> points = new java.util.ArrayList<Point>();
    private boolean pressedAction = false;
    private int x = 150;
    private int y = 150;
    private int z = 150;
    private int a = 150;
    public DisplayCoordinatePanelSEVEN() {
        addKeyListener(this);
        points.add(new Point(x,y));
    public void keyPressed(KeyEvent e) {
        pressedAction = true;
        switch (e.getKeyCode()) {
            case KeyEvent.VK_DOWN:
                //a = y + 10;
                y += 10;
                points.add(new Point(x,y));
                break;
            case KeyEvent.VK_UP:
                //a = y - 10;
                y -= 10;
                points.add(new Point(x,y));
                break;
            case KeyEvent.VK_LEFT:
                //z = x - 10;
                x -= 10;
                points.add(new Point(x,y));
                break;
            case KeyEvent.VK_RIGHT:
                //z = x + 10;
                x += 10;
                points.add(new Point(x,y));
        repaint();
    public void keyReleased(KeyEvent e) {
    public void keyTyped(KeyEvent e) {
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.BLACK);
        if (pressedAction) {
            for(int xx = 0, yy = points.size()-1; xx < yy; xx++)
              Point p1 = points.get(xx);
              Point p2 = points.get(xx+1);
              g.drawLine(p1.x, p1.y, p2.x, p2.y);
            pressedAction = false;
            //x = z;
            //y = a;
}

Similar Messages

  • How to make lines I draw as an objects??

    Hi friends:
    I met a problem here, I find a similiar code below, but cannot solve it.
    How to make lines I draw as objects in this application??
    ie the lines I draw will be selectable as other JLabels, can be highlighted, can be deleted etc, just like any other components or object,
    How to do this??
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.Vector;
    import java.lang.reflect.Array;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Drawines
         public static void main(String[] args)
            JFrame f = new JFrame("Draw Lines");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new ConnectionPanel());
            f.setSize(400,300);
            f.setLocation(200,200);
            f.setVisible(true);
    class Drawines extends JPanel
        JLabel                                       label1, label2, label3, label4;
        JLabel[]                       labels;
        JLabel                                       selectedLabel;
        protected              JButton btn            = new JButton("DrawLines");
        protected              JButton btn1           = new JButton("Clear");
        protected              JButton btn2           = new JButton("No Draw");
        protected                      boolean isActivated = false;
        protected           int      stoppoint     = 0;          
        int cx, cy;
        Vector order                     = new Vector();
        Vector order1                     = new Vector();
        Object[] arr                    = null;
        public ConnectionPanel()
            setLayout(null);
            addLabels();
            label1.setBounds( 25,  50, 125, 25);
            label2.setBounds(225,  50, 125, 25);
            label3.setBounds( 25, 175, 125, 25);
            label4.setBounds(225, 175, 125, 25);
            btn.setBounds(10, 5, 100, 25);
            btn1.setBounds(100, 5, 100, 25);
            btn2.setBounds(200, 5, 100, 25);
                add(btn);
             add(btn1);
             add(btn2);
            determineCenterOfComponents();
            ComponentMover mover = new ComponentMover();
             ActionListener lst = new ActionListener() {
                 public void actionPerformed(ActionEvent e) {
                     ComponentMover mover = new ComponentMover();
                           addMouseListener(mover);
                           addMouseMotionListener(mover);
                           isActivated = false;
            ActionListener lst1 = new ActionListener() {
                       public void actionPerformed(ActionEvent e) {
                           isActivated=true;
              btn.addActionListener(lst);
              btn1.addActionListener(lst1);
        public void paintComponent(final Graphics g)
             super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
             Point[] p;
                System.out.println("order.size()"+ order.size());
                System.out.println("order1.size()"+ order1.size());
                     if (!isActivated && order1.size()==0) {
                         for(int i = 0 ; i < order.size()-1; i++) {
                                JLabel l1 = (JLabel)order.elementAt(i);
                               JLabel l2 = (JLabel)order.elementAt(i+1);
                               order1.add(order.elementAt(i));
                               order1.add(order.elementAt(i+1));
                               System.out.println();
                               p = getCenterPoints(l1, l2);
                               g2.setColor(Color.black);
                                            g2.draw(new Line2D.Double(p[0], p[1]));            
                     }else if(!isActivated && order1.size()>0){
                             order=order1;
                         for(int i1 = 0 ; i1 < order.size()-1; i1++) {
                               JLabel l1 = (JLabel)order.elementAt(i1);
                               JLabel l2 = (JLabel)order.elementAt(i1+1);
                               System.out.println();
                               p = getCenterPoints(l1, l2);
                               g2.setColor(Color.red);
                                g2.draw(new Line2D.Double(p[0], p[1]));    
                                System.out.println(" order1.size() = " + order.size());
                     }else {
                          order1 = order;
                         for(int i1 = 0 ; i1 < order1.size()-1; i1++) {
                                    JLabel l1 = (JLabel)order1.elementAt(i1);
                                    JLabel l2 = (JLabel)order1.elementAt(i1+1);
                                    p = getCenterPoints(l1, l2);
                                    g2.setColor(Color.blue);
                                    if (order.elementAt(i1) !=null){
                                         g2.draw(new Line2D.Double(p[0], p[1]));    
        private Point[] getCenterPoints(Component c1, Component c2)
            Point
                p1 = new Point(),
                p2 = new Point();
            Rectangle
                r1 = c1.getBounds(),
                r2 = c2.getBounds();
                 p1.x = r1.x + r1.width/2;
                 p1.y = r1.y + r1.height/2;
                 p2.x = r2.x + r2.width/2;
                 p2.y = r2.y + r2.height/2;
            return new Point[] {p1, p2};
        private void determineCenterOfComponents()
            int
                xMin = Integer.MAX_VALUE,
                yMin = Integer.MAX_VALUE,
                xMax = 0,
                yMax = 0;
            for(int i = 0; i < labels.length; i++)
                Rectangle r = labels.getBounds();
    if(r.x < xMin)
    xMin = r.x;
    if(r.y < yMin)
    yMin = r.y;
    if(r.x + r.width > xMax)
    xMax = r.x + r.width;
    if(r.y + r.height > yMax)
    yMax = r.y + r.height;
    cx = xMin + (xMax - xMin)/2;
    cy = yMin + (yMax - yMin)/2;
    private class ComponentMover extends MouseInputAdapter
    Point offsetP = new Point();
    boolean dragging;
    public void mousePressed(MouseEvent e)
    Point p = e.getPoint();
    for(int i = 0; i < labels.length; i++)
    Rectangle r = labels[i].getBounds();
    if(r.contains(p) && !isActivated )
    selectedLabel = labels[i];
    order.addElement(labels[i]);
    offsetP.x = p.x - r.x;
    offsetP.y = p.y - r.y;
    dragging = true;
    repaint(); //added
    break;
    public void mouseReleased(MouseEvent e)
    dragging = false;
    public void mouseDragged(MouseEvent e)
    if(dragging)
    Rectangle r = selectedLabel.getBounds();
    r.x = e.getX() - offsetP.x;
    r.y = e.getY() - offsetP.y;
    selectedLabel.setBounds(r.x, r.y, r.width, r.height);
    //determineCenterOfComponents();
    repaint();
    private void addLabels()
    label1 = new JLabel("Label 1");
    label2 = new JLabel("Label 2");
    label3 = new JLabel("Label 3");
    label4 = new JLabel("Label 4");
    labels = new JLabel[] {
    label1, label2, label3, label4
    for(int i = 0; i < labels.length; i++)
    labels[i].setHorizontalAlignment(SwingConstants.CENTER);
    labels[i].setBorder(BorderFactory.createEtchedBorder());
    add(labels[i]);
    Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    2 choice, bundle your app in a jar, or get a native compiler.
    executable jar
    http://java.sun.com/j2se/1.3/docs/guide/jar/jarGuide.html
    http://developer.java.sun.com/developer/qow/archive/21/index.html
    native
    http://gcc.gnu.org/java/
    http://www-106.ibm.com/developerworks/library/j-native.html
    http://icafe.sourceforge.net/
    http://www.towerj.com/
    http://www.xlsoft.com/en/products/development/jet/jetpro.html

  • How to make lines for "fill in the blanks?" (iWork Pages 09)

    This should be easy since it's something many people do: design a form for others to fill out with a pen or pencil.  However, I can't find any information regarding how to make a line after text, like this:
    Name _________________ Address _________________________________ Phone __________
    ...without using the underline character.
    Back on the Clarisworks days there was some way to make nice neat lines after text using tabs.  However, It's been so long that I can't recall how it worked.  I've Googled this issue using every logical term I can think of but found nothing useful.  The Pages 09 help file and the user guide  seem to be mute on this subject. The Word 2008 help file is similarly silent.  However, I'm sure that the greater Pages community knows the answer to this one.
    Thanks,
    Bill

    What you want is called a tab leader. In Pages, to create the underline:
    To create a new tab stop using the Text inspector, click in the document where you want to create a new tab stop, click Inspector in the toolbar, and then click Tabs. Click the Add button in the bottom-left corner of the Tabs pane. The new tab stop appears in the Tab Stops column.
    Then  use the Leader drop down menu to choose a solid line:

  • How to make line-in come out rear speakers? (SB Live! 5

    Card is SB Li've! 5. DE and OS is XP SP2:
    ================================
    I have tried everything that I can think of. It was working fine until I installed a program which screwed up my mixer settings. I have loaded the default mixer settings. Now my rear speakers only work for wave devices, but not line-in.
    Is there a way to make line-in come out both the front and rear speakers, or set the rear speakers to duplicate the front speakers (losing the surround feature)?
    Failing that I will have to resort to plugging both sets of speakers into the one socket via an adapter - I don't wish to do this as I had this working for many months.
    Please help.
    grol
    Message Edited by groslchie on <SPAN class=date_text>-2-2005 <SPAN class=time_text>07:22 AM
    Message Edited by groslchie on -2-2005 07:23 AM

    Weird. I just installed Creative PlayCenter from the driver CD and after the reboot, line-in now comes out the rear speakers again. Must've been some system files updated or something, because CMSS is still off according to PlayCenter. When I turn CMSS on, the line-in stops coming out rear, but turning it off makes it work!!!! So it's sorted, but still have no idea why it screwed up and why I needed PlayCenter installed to change the CMSS settings.

  • How to make profitability segment pushbutton visible  in FB50 transaction

    Hi All ,
    I want to make  profitability segment pushbutton visible  in FB50 transaction. I tried to change a  transaction variant which is assigned for this transaction code. It was a user created Z transaction variant and i unchecked the invisible checkbox in SHD0 transaction  and saved it.But still in FB50 i am unable to see it. Can anyone tell me why it is still invisible though i unchecked the invisible checkbox . Do i need to reassign the transaction variant again to FB50. I didnt do it because it is already assigned and i had just modified.

    Hi,
    In SPRO there is no Field selection for QA. If you want to maintain QA based MPN( get the material number relevant to MPN). Press F4 and select the search criteria search by MPN, you will get the material relevant to that MPN.
    Malleswari

  • How to make lines for writing?

    How do I create lines for writing?

    tablet = note book
    Make the paragraph style as mentioned above. Adjust the space after as desired, the line weight for the rule below. Press enter for each paragraph.
    Mike

  • How to make line thicker?

    When I use "g.drawLine()" to draw a line,the size of the line is fixed.But I would like to make the line thicker.How to do that?Thanks!

    one of my favorite methods :)
        void drawThickLine(Graphics2D g, double x1, double y1, double x2, double y2, double width) {
            Stroke orig = g.getStroke();
            BasicStroke wideStroke = new BasicStroke((float)width);
            g.setStroke(wideStroke);
            g.draw(new java.awt.geom.Line2D.Double(x1,y1,x2,y2));
            g.setStroke(orig);
        }Enjoy!

  • How to make line chart start at y-axis?

    How do you make the series on a line chart start at the y-axis?  I tried adding a data point for y(x=0), but the Xcelsius graph drops it and starts with y(x=1).  How do I fix that?  This is especially important for series that need to start at zero.

    Post Author: amr_foci
    CA Forum: Xcelsius and Live Office
    its all based on ur design of your Excel sheet
    design how it will be in Excel first
    then go to xeclsius
    ,,, by the way it looks very easy task
    you can do it.

  • How to make rollback segments online on database startup?

    I create some rollback segments in users tablespace, but how can I auto make these rollback segment online on database startup?
    thanks!!

    Add the name of the rollback segments to rollback_segments parameter in the init.ora file.
    edwin

  • How to make lines in GridLayout?

    I use GridLayout with 2 columns and many rows. I want to draw a line between the two columns. How can I do this in GridLayout?

    tjacobs01 wrote:
    overridding paintComponent probably won't work, because the children will paint over it. Not if the opaque has been set. Also, I wonder if the "gaps" will show through even if the children keep opaque true.
    Yep, you can do this by setting the background color of the panel to the column line color you desired, and let this color "shine through" the gaps in the grid layout:
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.GridLayout;
    import javax.swing.BorderFactory;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JComponent;
    import javax.swing.SwingConstants;
    public class GridsShowQuestion
      private static final int GAP = 10;
      private static final int ROWS = 3;
      private static final int COLS = ROWS;
      private static final int FONT_SIZE = 50;
      private JPanel mainPanel = new JPanel();
      public GridsShowQuestion()
        mainPanel.setBackground(Color.red);
        mainPanel.setLayout(new GridLayout(ROWS, COLS, GAP, 0));
        for (int i = 0; i < ROWS; i++)
          for (int j = 0; j < COLS; j++)
            JLabel lbl = new JLabel("X");
            lbl.setFont(new Font(Font.DIALOG, Font.BOLD, FONT_SIZE));
            int eb = 10;
            lbl.setBorder(BorderFactory.createEmptyBorder(eb, 3*eb, eb, 3*eb));
            lbl.setHorizontalAlignment(SwingConstants.CENTER);
            lbl.setOpaque(true);
            mainPanel.add(lbl);
      public JComponent getComponent()
        return mainPanel;
      private static void createAndShowUI()
        JFrame frame = new JFrame("GridsShowQuestion");
        frame.getContentPane().add(new GridsShowQuestion().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();
    }Edited by: Encephalopathic on Oct 14, 2008 7:16 PM

  • NEED HELP!!!How to make LINES Colorful--PLEASE HELP!!!!!!

    i want to draw a red line:
    Graphics g;
    g = b.getGraphics();
    g.drawLine(20,5,100,64);
    but the line is black, i want it red.
    the command g.setColor(color.RED) is not working....
    WHATS WRONG, please help, thanks thomas

    Here is my code....
    mport com.ms.wfc.app.*;
    import com.ms.wfc.core.*;
    import com.ms.wfc.ui.*;
    import com.ms.wfc.html.*;
    import com.ms.awt.*;
    * Diese Klasse kann eine variable Anzahl von Parameter auf der Befehlszeile
    * entgegennehmen. Die Programmausf�hrung startet mit der Methode main(). Der
    * Klassenkonstruktor wird nicht aufgerufen, bevor nicht ein Objekt vom Typ 'exel'
    * in der Methode main() erstellt wird.
    public class exel extends Form
         String datum2="";
         String userdateinput="";
         int count=0;
         int i=0;
         int day7=0;
         int m=0;
         int p=0;
         public exel()
              super();
              for (i=0;i<31;i++)
              Point[count]="305";
         Graphics g;
         int xx1=5;
         int xy1=305;
         int xx2=600;
         int xy2=305;
         int yx1=5;
         int yy1=5;
         int yx2=5;
         int yy2=305;
         int i=0;
         //Bitmap b = new Bitmap("c:\\BACKGROUND.BMP");
         Bitmap b = new Bitmap(600,600);
         b.setTransparentColor(Color.RED);
         g = b.getGraphics();
         g.drawRect(0,0,600,600);
         g.drawRect(0,0,600,600);
         g.setBackColor(Color.RED);
    g.setColor(Color.RED);//HERE IS THE ERROR!!!
         g.drawLine(5,10,5,305);
         g.drawLine(5,10,10,10);
         g.drawLine(xx1,xy1,xx2,xy2);
         for (i=0;i<5;i++)
              yx1=5;
              yy1=60+yy1;
              yx2=10;
              yy2=yy1;
              g.drawLine(yx1,yy1,yx2,yy2);
         for (i=0;i<31;i++)
              xx1=xx1+15;
              xy1=305;
              xx2=xx1;
              xy2=300;
              g.drawLine(xx1,xy1,xx2,xy2);
         int h=0;
         int counter7=0;
         yx1=-10;
         int counter8=0;
         int counter6=0;
         for (h=1;h<31;h++)
              int cpoint=com.ms.wfc.util.Value.toInt(Point[h-1]);
              int cpoint2=com.ms.wfc.util.Value.toInt(Point[h]);
              yy1=305-(cpoint*3);
              yy2 = 305-(cpoint2*3);
              yx1=yx1+15;
              yx2 = yx1+15;
              if (cpoint==0)
                   yy1 = 0;
                   yy2 = 0;
                   yx1 = 0;
                   yx2 = 0;
              if (cpoint2==0)
                   yy1 = 0;
                   yy2 = 0;
                   yx1 = 0;
                   yx2 = 0;
              g.drawLine(yx1,yy1,yx2,yy2);
              if (cpoint==0)
                   for (counter6=0;counter6<counter7;counter6++)
                        yx1=yx1+15;
                        yx2 = yx1+15;
              if (cpoint2==0)
                   for (counter8=0;counter8<counter7;counter8++)
                        yx1=yx1+15;
                        yx2 = yx1+15;
              counter7++;
         pictureBox1.setImage(b);
              // Erforderlich f�r die Unterst�tzung des Visual J++-Formulardesigners
              initForm();          
              // ZU ERLEDIGEN: F�gen Sie beliebigen Konstruktorcode hinter den Aufruf von initForm hinzu
         * exel �berl�dt dispose, damit es die Komponentenliste
         * bereinigen kann.
    public void dispose()
         super.dispose();
         components.dispose();
    String DATUM="";
    private void start_click(Object source, Event e)
         /**DATE**/
         java.util.Date Date = new java.util.Date();
         java.sql.Date sqldate = new java.sql.Date(Date.getTime());
         String dat = String.valueOf(sqldate);
         //datum.setText(DATUM);
         //Start von EXEL
         try
              String makro="C:\\Program Files\\Microsoft Office\\Office\\XLSTART\\PERSONL.xls";
              String cmd = "C:\\Temp\\"+DATUM+"FLIP.xls";
              //String cmd = "C:\\Program Files\\Microsoft Office\\Office\\EXCEL.EXE Gr8galry.gra";
              String line = null;
              Process p1 = Runtime.getRuntime().exec(cmd);
              Process p2 = Runtime.getRuntime().exec(makro);
              //p.destroy();
         catch (java.io.IOException e1)
              //exception.setText("error");
    String Point[]=new String[31];
    private void button1_click(Object source, Event e)
         close();
    }

  • How to make data persist in form?

    Hi
    I've made multiple forms for a Web site. Each form is within its own module. The problem is the data entered into a form disappears as soon as the user shifts to another form (and consequently, another module). How to make the data persist in the form even if the user shifts away to another module? I've tried using a Model to hold the data but the data didn't stay in the text fields.
    <fx:Declarations>
         <fx:Model  id="babyModel1">
              <BabyForm>
                   <CleaningProducts>{babyCleanProd.text}</CleaningProducts>
                   <BabyProducts>{babyProd.text}</BabyProducts>
              </BabyForm>
         </fx:Model>
    </fx:Declarations>
    <mx:Form id="babyQuestionnaire" x="140" y="40" >
         <mx:FormItem width="100%" label="Baby Cleaning Products1">
              <s:RichEditableText 
                   id="babyCleanProd"
                   width="200"
                   height="100"
                   backgroundColor="#ffffff"
                   paddingLeft="4" paddingRight="4" paddingTop="4" paddingBottom="4"
                   color="#222222"
                   />
         </mx:FormItem>
         <mx:FormItem width="100%" label="Baby Products1">
              <s:RichEditableText  id="babyProd"
                       width="200"
                        height="100"
                        backgroundColor="#ffffff"
                        paddingLeft="4" paddingRight="4" paddingTop="4" paddingBottom="4"
                        color="#222222"/>
             </mx:FormItem>
    </mx:Form>
    Any solutions? The data persists in the text fields if the forms are all in the same central application but then there's lots of code for each form.
    Thanks for your attention.
    Kearney

    I thought ModuleLoader could only load one Module at a time, and unloaded the current Module when called to load the next Module. This app has only one ModuleLoader, which loads various modules as different states are called.
    If the Model to hold the form data is in the shell application, how to wire each Model to each Form (assuming the forms are still in various modules)?
    Thanks.
    Kearney

  • Why can't Illustrator's line segment tool make a stroke of .5 pt?

    Why can't Illustrator's line segment tool make a stroke of .5 pt? When I create a line at either 90° or 180° I cannot make the stroke thinner than 1 pt., even if I create the line first and then try to change its stroke. When I create a line at any other angle I can make the line thickness whatever I want by changing its stroke thickness. What I want is to make line segments that are .25 or .5 pts, but the minimum Illustrator will do is 1 pt even if I select the line or rectangle and try to change it to .5 or .25 pt. This same problem exists with the rectangle tool when I create a rectangle oriented at either at 90° or 180°, but if I rotate that same rectangle to anything other than 90° or 180° I will then have the ability to change the thickness to less than 1 pt. Any ideas what's going on?

    Well, this is good information, but it does not quite get me there. I get as far as {user}:Library:Application Support:Adobe:
    but there is no Adobe Illustrator folder. Suggestions?
    I want to suggest they add Hyphenation to that list. I never hyphenate anything, and I can't count the number of times I have had to uncheck the hyph box in InDesign and Illustrator. Can you point me to the appropriate suggestion box? Thx D

  • How to make DFF Read Only ..

    Dear Friends,
    I have 3 segments in the Additional Personal Details DFF in HRMS. I want to make only the 2nd segment read-only not all the segments.How can we achieve this can any one pls let me know about this ...
    with regards
    Swpana

    Hi,
    Review the following documents and see if it helps.
    Note: 438215.1 - How To Make DFF Segments Read Only Using OAF Personalise
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=438215.1
    Note: 750679.1 - How To Make Only Some Of The Segments Of A Descriptive Flexfield Read Only On OA Framework
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=750679.1
    Note: 149452.1 - How do you make a descriptive flexfield display only?
    https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=149452.1
    Regards,
    Hussein

  • How can I make the line segment tool repeat several times?

    How can I make the line segment tool repeat several times?

    If this is what you want, hold the ~ key on your keyboard while dragging with the tool.
    If you want spaced copies of the completed line, use the Transform Effects from the Effects menu.

Maybe you are looking for