At a dead end.  A java student in need of help.

I've hit a wall.
The program is supposed to allow the user to draw five different polygons using the polygon class and let the user pick the color for each polygon and move each polygon around the screen once it is filled in. The user clicks to add the points and then double clicks to fill in the polygon. Then the polygon is added to the array. Up to the dragging around the screen the program works fine. When I click on a polygon with the shift down nothing happens and I've spent several hours trying to figure out why.
I've placed several System.out.println's in the code and I think I've narrowed down the problem. (I hope) I think it might have something to do with the canvas repainting. Because the S.O.P's show that the program is going through and executing that code. It might also have something to the do with my polygon array, but to my knowledge that is setup fine.
Thanks a bunch if you try to help.
Brad
// Full Code Below
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class poly extends JFrame implements ActionListener
     /* Accessible Variables */
     private JPanel canvas;
     private JPanel mp;
     private JComboBox choice;
     private JButton reset;
     private Podly polyArray[] = new Podly[5];
     private Podly currentPoly = new Podly();
     private Podly movingPoly = new Podly();
     private int count;
     private Color currentColor;
     private Point firstPoint;
     private boolean newPoly = true;
     private boolean moving = false;
     private boolean overflowed = false;
     poly()
          setTitle("Polygon");
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          count = 0;
          /* Interactive Buttons and Menus */
          JMenuBar tp = new JMenuBar();
          JMenu color = new JMenu("Color");
          JMenuItem MBlack = new JMenuItem("Black");
          color.add(MBlack);
          JMenuItem MRed = new JMenuItem("Red");
          color.add(MRed);
          JMenuItem MGreen = new JMenuItem("Green");
          color.add(MGreen);
          JMenuItem MYellow = new JMenuItem("Yellow");
          color.add(MYellow);
          MBlack.addActionListener(this);
          MRed.addActionListener(this);
          MGreen.addActionListener(this);
          MYellow.addActionListener(this);
          tp.add(color);
          canvas = new CanvasArt();
          canvas.setBackground(Color.white);
          canvas.addMouseListener(new Points());
          canvas.addMouseMotionListener(new Moved());
          choice = new JComboBox();
          choice.addItem("Black");
          choice.addItem("Red");
          choice.addItem("Green");
          choice.addItem("Yellow");
          choice.addActionListener(this);
          reset = new JButton("Reset");
          reset.addActionListener(this);
          JLabel chooseColor = new JLabel("Choose a color:");
          JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
          mp = new JPanel();
          mp.add(chooseColor);
          mp.add(choice);
          mp.add(reset);
          mp.add(holdShift);
          setJMenuBar(tp);
          getContentPane().add(canvas);
          getContentPane().add(mp, "South");          
     public static void main(String [] args)
          JFrame main = new poly();
          main.setSize(600, 600);
          main.setVisible(true);
     public void actionPerformed(ActionEvent e)
          Object test = e.getSource();
          Object selection;
          if (test instanceof JComboBox)
               JComboBox source = (JComboBox)e.getSource();
               selection = source.getSelectedItem();
               if (selection.equals("Black")) currentColor = Color.black;
               else if (selection.equals("Red")) currentColor = Color.red;
               else if (selection.equals("Green")) currentColor = Color.green;
               else if (selection.equals("Yellow")) currentColor = Color.yellow;
          else if (test instanceof JButton) // Repaints if Reset Button is Pressed
               repaint();
               currentPoly.reset();
               count = 0;
               overflowed = false;
          else
               JMenuItem source = (JMenuItem)e.getSource();
               selection = source.getText();
               if (selection.equals("Black")) currentColor = Color.black;
               else if (selection.equals("Red")) currentColor = Color.red;
               else if (selection.equals("Green")) currentColor = Color.green;
               else if (selection.equals("Yellow")) currentColor = Color.yellow;
     class Podly extends Polygon // Class adds Color Fuctionality to Polygon class
          Color polyColor;
          void setColor(Color y)
          {polyColor = y;}
          Color getColor()
          {return polyColor;}
     /* Canvas Painting Panel */
     class CanvasArt extends JPanel
          public void paintComponent(Graphics g)
               super.paintComponent(g);
               System.out.println("Canvas is called");
               System.out.println(polyArray);
               for (int i=0; i>count;i++)
                    System.out.println("Loop is going");
                    Podly y = polyArray;
                    g.setColor(y.getColor());
                    g.fillPolygon(y);
                    System.out.println(y);
                    System.out.println("Loop has filled in polygon"); // Test
               System.out.println("painting complete");
     class Points extends MouseAdapter
          public void mousePressed(MouseEvent e)
               Graphics g = canvas.getGraphics();
               if (overflowed) // Checks for overflow in program.
                    g.setColor(Color.RED);
                    Font font = new Font("SansSerif",Font.BOLD, 30);
                    g.setFont(font);
                    g.drawString("OVERFLOW", 10, 30);
                    Font font2 = new Font("SansSerif",Font.BOLD, 20);
                    g.setFont(font2);
                    g.setColor(Color.BLUE);
                    g.drawString("Double Click to Play Again", 10, 50);
                    if (e.getClickCount() == 2) // Allows user to play again.
                         repaint();
                         currentPoly.reset();
                         count = 0;
                         overflowed = false;
               else
                    int x = e.getX();
                    int y = e.getY();
                    if (newPoly)
                         firstPoint = new Point(x,y);
                         if (e.isShiftDown())
                              System.out.println("Gets before Check loop");
                              for (int r=count-1;r>=0;r--)
                                   System.out.println("Inside For Check Loop");
                                   System.out.println(polyArray[r]);
                                   if (!polyArray[r].contains(x,y))          
                                        System.out.println("Point is found");
                                        movingPoly = polyArray[r];
                                        System.out.println("MovingPoly Defined");
                                        moving = true;
                                        System.out.println("Moving is true"); // test
                                        break;
                         else
                              currentPoly.setColor(currentColor);
                              currentPoly.addPoint(x,y);
                              g.fillOval(x,y,1,1);
                              newPoly = false;
                    else
                         if (e.getClickCount() == 2)
                              g.setColor(currentPoly.getColor());
                              g.fillPolygon(currentPoly);
                              polyArray[count] = currentPoly;
                              currentPoly.reset();
                              count++;
                              if (count == polyArray.length)
                              {overflowed = true;}
                              newPoly = true;
                         else
                              g.setColor(currentPoly.getColor());
                              currentPoly.addPoint(x,y);
                              g.drawLine(firstPoint.x, firstPoint.y, x, y);
                              firstPoint.move(x,y);
          public void mouseReleased(MouseEvent e)
               if(e.isShiftDown())
               { moving = false; }
     class Moved extends MouseMotionAdapter
          public void mouseDragged(MouseEvent e)
               if (moving && e.isShiftDown())
                    int x = e.getX();
                    int y = e.getY();
                    System.out.println("Gets here");
                    movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                    firstPoint.move(x,y);
                    canvas.repaint();

Here is the updated code still with the color error I talked about above.
:) Thanks for all the help everyone.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class poly extends JFrame implements ActionListener
     /* Accessible Variables */
     private JPanel canvas;
     private JPanel mp;
     private JComboBox choice;
     Podly [] polyArray;
     private Podly currentPoly;
     private Podly movingPoly;
     private int count;
     private Color currentColor;
     private Point firstPoint;
     private Color polyColor;
     private boolean newPoly = true;
     private boolean moving = false;
     private boolean overflowed = false;
     poly()
          setTitle("Polygon");
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);  // Exits program on window close.
          polyArray = new Podly[5];
          count = 0;                                      // Set count to zero.
          /* Interactive Buttons and Menus */
          JMenuBar tp = new JMenuBar();
          JMenu color = new JMenu("Color");
          JMenuItem MBlack = new JMenuItem("Black");
          color.add(MBlack);
          JMenuItem MRed = new JMenuItem("Red");
          color.add(MRed);
          JMenuItem MGreen = new JMenuItem("Green");
          color.add(MGreen);
          JMenuItem MYellow = new JMenuItem("Yellow");
          color.add(MYellow);
          MBlack.addActionListener(this);
          MRed.addActionListener(this);
          MGreen.addActionListener(this);
          MYellow.addActionListener(this);
          tp.add(color);
          canvas = new CanvasArt();
          canvas.setBackground(Color.white);
          canvas.addMouseListener(new Points());
          canvas.addMouseMotionListener(new Moved());
          choice = new JComboBox();
          choice.addItem("Black");
          choice.addItem("Red");
          choice.addItem("Green");
          choice.addItem("Yellow");
          choice.addActionListener(this);
          JLabel chooseColor = new JLabel("Choose a color:");
          JLabel holdShift = new JLabel("Hold shift, click, and drag to move a polygon.");
          mp = new JPanel();
          mp.add(chooseColor);
          mp.add(choice);
          mp.add(holdShift);
          setJMenuBar(tp);
          getContentPane().add(canvas);
          getContentPane().add(mp, "South");          
     /* Button Listeners */
     public void actionPerformed(ActionEvent e)
          Object test = e.getSource();
          Object selection;
          if (test instanceof JComboBox)
               JComboBox source = (JComboBox)e.getSource();
               selection = source.getSelectedItem();
               if (selection.equals("Black")) currentColor = Color.black;
               else if (selection.equals("Red")) currentColor = Color.red;
               else if (selection.equals("Green")) currentColor = Color.green;
               else if (selection.equals("Yellow")) currentColor = Color.yellow;
          else
               JMenuItem source = (JMenuItem)e.getSource();
               selection = source.getText();
               if (selection.equals("Black")) currentColor = Color.black;
               else if (selection.equals("Red")) currentColor = Color.red;
               else if (selection.equals("Green")) currentColor = Color.green;
               else if (selection.equals("Yellow")) currentColor = Color.yellow;
     class Podly extends Polygon  // Class adds Color Fuctionality to Polygon class
          void setColor(Color y)  // sets the Polygon's color.
          {polyColor = y;}
          Color getColor()   // returns the Polygon's color.
          {return polyColor;}
     /* Canvas Painting Panel */
     class CanvasArt extends JPanel
          public void paintComponent(Graphics g)
               super.paintComponent(g);
                    for (int i=0; i<count;i++)
                         g.setColor(polyArray.getColor());
                         g.fillPolygon(polyArray[i]);
     class Points extends MouseAdapter
          /* Listens for mouse press, constructs polygons, stores them in array. */
          public void mousePressed(MouseEvent e)
               Graphics g = canvas.getGraphics();
               if (overflowed) // Checks for overflow in program.
                    g.setColor(Color.RED);
                    Font font = new Font("SansSerif",Font.BOLD, 30);
                    g.setFont(font);
                    g.drawString("OVERFLOW", 10, 30);
                    Font font2 = new Font("SansSerif",Font.BOLD, 20);
                    g.setFont(font2);
                    g.setColor(Color.BLUE);
                    g.drawString("Double Click to Play Again", 10, 50);
                    if (e.getClickCount() == 2) // allows user to play again by resetting.
                         repaint();
                         count = 0;
                         overflowed = false;
               else
                    int x = e.getX();
                    int y = e.getY();
                    if (newPoly)
                         firstPoint = new Point(x,y);
                         if (e.isShiftDown())
                              for (int r=count-1;r>=0;r--)
                                   if (polyArray[r].contains(x,y))          
                                        movingPoly = polyArray[r];
                                        moving = true;
                                        break; // exits for loop after Polygon with point is found.
                         else
                              currentPoly = new Podly();
                              currentPoly.addPoint(x,y); // Adds the first point.
                              currentPoly.setColor(currentColor); // Sets the Polygon Color
                              g.fillOval(x,y,1,1);
                              newPoly = false;
                    else
                         /* Close the current Polygon at double click,
                         * then moves on to the next. */
                         if (e.getClickCount() == 2)
                              g.setColor(currentPoly.getColor());
                              g.fillPolygon(currentPoly);
                              polyArray[count] = currentPoly;
                              count++;
                              if (count == polyArray.length)
                              {overflowed = true; canvas.repaint();}
                              newPoly = true;
                         else
                              g.setColor(currentPoly.getColor());
                              currentPoly.addPoint(x,y);
                              g.drawLine(firstPoint.x, firstPoint.y, x, y);
                              firstPoint.move(x,y);
          /* Listens for mouse release */
          public void mouseReleased(MouseEvent e)
               if(e.isShiftDown())
               { moving = false; }
     /* Moves selected Polygon around */
     class Moved extends MouseMotionAdapter
          public void mouseDragged(MouseEvent e)
               if (moving && e.isShiftDown())
                    int x = e.getX();
                    int y = e.getY();
                    movingPoly.translate((x-firstPoint.x),(y-firstPoint.y));
                    firstPoint.move(x,y);
                    canvas.repaint();
     public static void main(String [] args)
          JFrame poly = new poly();
          poly.setSize(600, 600);
          poly.setVisible(true);

Similar Messages

  • Java Student In Need Of Help - JDBC

    I need to create a connection between a MS Access database and my Java Application. Could anyone help me with this? I've tried the online tutorials but I still could not manage to get my head around it!
    Please help
    Finbarr.

    hey lee
    i'm just after finding a good site on JDBC with MS ACCESS, so i'm going to study this and see can i make head or tails of it! i really want to try and see if i can do it myself first. If i'm having trouble I'll get back to ya!
    This is my first time in here!
    Thanx
    Fin.

  • A new Java Student in need of help

    I am new to this Java language and while so far I have found it to be quite easy I have now come up against a program that is giving me some problems. Our teacher has given us this program that had a bunch of errors and we had to find them and also correct them. There were 20 errors to start and I have gotten it down to only 2 errors but I cannot figure out how to correct them. The teacher said to use whatever we could get our hands on to help us correct this code (internet, books, etc) so I figured that I would try this message board. This is my first post so could someone please give me a hand? Here is the code:
    import java.util.*;
    public class Names
    public static void main(String args)
    try
    List list = createList(args);
    Collections.sort(list);
    Iterator i = list.iterator();
    while (i.hasNext())
    String s = (String) i.next();
    system.out.println(s);
    catch (Exception e)
    System.out.printlnn("Exception"+ e.getMessage() "\n");
    private static List createList(String args[]) throws Exception
    List List;
    if (args.length == 0 || argx(0).equals("ArrayList"))
    list = ArrayList();
    System.out.println("Using ArrayList");
    else if (args[0].equals("LinkedList"))
    list = new LinkedList();
    system.out.println("Using LinkedList");
    else if
    throw new Exception
    ("invalid argument " + args[0] + ". Valid choices are ArrayList or LinkedList");
    fillList(list);
    return list;
    private static void fillList (List list)
    list.add("Jim");
    list.add("Helen");
    list.add("Jennifer");
    list.add("Daniel");
    list.add("Michelle");
    and here are the 2 errors that I can't seem to figure out:
    C:\$jg105\Names.java:24: ')' expected.
    System.out.printlnn("Exception"+ e.getMessage() "\n");
    ^
    C:\$jg105\Names.java:41: '(' expected.
    else if
    ^
    2 errors
    Finished
    any help will be appreciated thanks Bob

    import java.util.*;
    //add this:
    import java.util.LinkedList;
    public class Names
    //CHANGE    public static void main(String args) {
        public static void main(String[] args) {
            try {
                List list = createList(args);
                Collections.sort(list);
                Iterator i = list.iterator();
                while ( i.hasNext() ) {
                    String s = (String) i.next();
    // CHANGE               system.out.println(s);
                    System.out.println(s);
            catch (Exception e) {
    // CHANGE           System.out.printlnn("Exception"+ e.getMessage() "\n");
            System.out.println("Exception"+ e.getMessage()+"\n");
        private static List createList(String args[]) throws Exception {
    // CHANGE       List List;
            List list;
    // CHANGE       if ( args.length == 0 || argx(0).equals("ArrayList") ) {
            if ( args.length == 0 || args[0].equals("ArrayList") ) {
    // CHANGE           list = ArrayList();
                list = new ArrayList();
                System.out.println("Using ArrayList");
            } else if ( args[0].equals("LinkedList") ) {
                list = new LinkedList();
    // CHANGE           system.out.println("Using LinkedList");
                System.out.println("Using LinkedList");
    // CHANGE       } else if {
                } else {
                throw new Exception
                    ("invalid argument " + args[0] + ". Valid choices are ArrayList or LinkedList");
            fillList(list);
            return list;
        private static void fillList (List list) {
            list.add("Jim");
            list.add("Helen");
            list.add("Jennifer");
            list.add("Daniel");
            list.add("Michelle");
    }

  • HT4993 A CHINESE STUDENT REALLY NEED YOUR HELP!!

    A CHINESE STUDENT REALLY NEED YOUR HELP!!
    Dear Sir or Madam,
    As I bought my iPhone 5 (16GB,White) in the USA from Sprint, full price with tax,  unlocked ,it was excepted to be a global phone. But now I come across with some problems in China  using local carrier, everything is working properly except sending text message, and iMessage and Facetime also seem not to work.This is very serious for Apple and me! Will I have the chance to fix this?
    I tried all the possible solutions from the Internet, and the Official solution offered by Apple (http://support.apple.com/kb/TS4459), but it doesn't seem to work.
    Will Apple help me with this issue? Please do.
    Information of my iPhone:
    SN: :F1*******8GJ
    <Personal Information Edited by Host>

    luyao49 wrote:
    A CHINESE STUDENT REALLY NEED YOUR HELP!!
    Dear Sir or Madam,
    As I bought my iPhone 5 (16GB,White) in the USA from Sprint, full price with tax,  unlocked
    No such thing is sold from any authorized source in the US. The Sprint phone is not unlocked. It can be unlocked by Sprint for use on international (non US) carriers for current Sprint customers in good standing after completing (I believe) 60 days of service.
    If you are having problems using certain features on an unsupported carrier, you'll have to work it out with your carrier.

  • My phone doesn't last more than two hours before the battery is dead. Any one know how to make the battery last longer? College student in need of help!

    I used to be able to go all day without charging my phone but now I have to charge it like every two hours and as a college student who also works. I go most of my day with a dead phone. Does anyone know how to make your battery last longer?

    Eight Battery Saving settings for your iPhone and iPad | MacIssues
    The Ultimate Guide to Solving iOS Battery Drain — Scotty Loveless

  • Student in need of HELP!Best application for writting java Code?

    I've been working on two different systems and need to be able to work on both..On one system the SDK is installed on a linux machine on another on a windows machine...unfortunately i cant open the linux created files on my windows machine although i can compile ad run them! What application would allow me to work on both systems wothout creating problems?

    Hi,
    I am a bit confused by this question. My colleagues here use Windows to create their files and I use a Linux machine. I have never encountered a problem as described here. Its a company policy here for everyone to save files in UNIX format, so I can readily open and edit those files created in Windows on my Linux box with NetBeans or EMACS I use. Sometimes when my colleagues forget to save their files in UNIX format, I have to apply dos2unix to mend those files, but still that isnt too teadious at all.
    Try opening the files you created in Windows with any text editor that you have available in Linux - vi, emacs, gEdit whatever. And please tell here what problems, if any you encountered, in actually editing them again.
    Correct me if I have misunderstood your question.
    hth,
    Binil

  • I wish to teach Java, but may need some help

    Hi,
    I teach Junior High, and since no formal programming class exists, I have made a programming club. We have spent the last while doing some mindless tech work, but now I want to get them bitting their teeth on Java. I taught it a few years ago, so the code doesn't worry me a bit. Its more the initial setup and I'm open to ideas.
    Primarily, each computer connects to the host with a private directory (h: drive) and a public (s: drive)
    While I'm reluctant to load java on 30 machines (as the club handles 4-8 at a time) is there a way to install Java on the public drive and allow students to access it from time to time?
    Is there a smaller version of java that might be better? We will not be using any various libraries, focusing more on input and output and really simple programs...
    I also noticed that notepad is attaching .txt to our java files. I'm just going to have to get used to the students renaming their files before compiling...
    any advice on the setup and teaching will be great!
    thx

    hi
    i am s tudent myself and i will tell u what they r doin in out college lab
    we have around 200 systems in the lab and they have installed java on only the server. The folder in the server is mapped on to each system as it boots. Indeed this makes the process of logging in slow...but it eliminates implementation of java on each machine. most students do have a copy of the compiler in our logins for better usage.
    as for using notepad, i would suggest other java ide rather than notepad....jcreator is the best i have seen so far...editplus is also good(its so small not even 1mb)
    the above products are license free for trial usage and cost a little for registration...
    actually jcreatorLE is completely free...try using it...
    all the best in ur endeavour...
    cheers
    rizi

  • Desperate student in need of help with assignment =(

    Please skip this bit if you don't want to read the things that led to this point
    Hi, Im ICTstudent. Im trying to finish school before the summer holidays and find a job so I can afford an appartment to live in with my girlfriend.
    I have an assignment that I need to finish asap because of the nearing summer holidays. My coach told me that it should take me about a weekend to finish it, so I asked my teacher to send me all the relevant data. after downloading oracle express edition etc, i installed them on vista and encountered a lot of problems (which I finally resolved thanks to this fantastic forum!)
    However, this means that I have been working on this assignment for 2 days already. Just when I wanted to start working on the Form I need to build, I discovered that my teacher had sent me the wrong DB model :s :s :s I now had to rebuild the entire db =(
    So, almost 2 days later I built the new db and basic form (which is filling the tables on the form with the db records) in Forms Builder. Now ive spent almost double the time i should have on this assignment, and I have to build a number of constraints... I have no clue how to even start with these =( That's why I'm asking you guys for help. I know its a lot to ask for, but I really have no other ideas.
    Thanks for any help you can offer me
    The assignment I got from my teacher:
    Create a master detail form that looks like this:                              
    http://img222.imageshack.us/img222/4531/masterdetail.jpg
    Which I did, It fills it up nicely with data from the DB, except for the following things:
    Number of highest bids:
    The number of highest bids the bidder has in the itemlist (if it exceeds the minimum price).
    Include the following constraint:
    bid.date needs to be in time for the auction. This means that it must be before auction.date.
    Add a function that:
    When activated, changes all the “Bid number” numbers into the number which has the highest bid, as long as it is higher then the min price.
    Tables:
    Bid:
    bidID
    auctionlistID
    memberID
    bid
    date
    member:
    memberID
    name
    adres
    city
    auctionlist:
    auctionlistID
    description
    maxbid
    minbid
    auction:
    auctionID
    date
    index:
    auctionID
    auctionlistID
    Thanks for reading :)

    You get marks for honesty. Often students who post here don't admit to their status. Some responders seems to be wound up by students asking for help. I don't know why, maybe they've forgotten what it was like to be a beginner. Me, I'm happy as long as I get a course credit.
    By the way, a set of CREATE TABLE scripts is generally more helpdul than bald DESC statements.
    Your BID table doesn't seem to have a column for amount, which will make it hard to implement Number of highest bids Unless that is what the BID column means, in which case it needs a clearer name.
    Include the following constraint will have to be done as a input validation in the form, as these sorts of cross-table constraints are hard to implement in the database. Come to think of it, you probably want to include some input validation to ensure that a new BID meets the MINAMT.
    Add a function that not sure what the point of that function would be.
    Having read through your post I think you are in the wrong forum. This is a database PL/SQL forum; really you should be asking your question in [the Forms forum|http://forums.oracle.com/forums/forum.jspa?forumID=82]
    Which leads me to my last point: what is your question? You have given us lots of info but you haven't explained what you need from us.
    Good luck
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Student in need of help

    Hello,
    Iam a new student to Oracle and SQL I need to find out what these symbols and terms do in this language. RUN START / @ GET. I was told that there are multiple purpose keys????
    Please HELP
    Thank you

    These are actually SQL*PLUS commands, and not sql commands. SQL*Plus is Oracle's command line interface to sql.
    @file_name Runs the specified command file
    /          Runs the command currently in the buffer
    GET        Loads the specified operating session file into
               the buffer
    RUN        Lists and runs the command currently in the buffer
    START      Is the same as @

  • Student in need of help (Trouble merging cells in CS3)

    I am currently attending college, pursuing a degree in computer systems. One of the required courses is web design. I am using Adobe Dreamweaver CS3, and lets just say, I don't particularly like it.
    Our instructor wants us to familiarize ourselves with Dreamweaver by building a basic page using tables.
    His required outline is this : http://img231.imageshack.us/img231/3855/pagedesign.png
    Now, to start, I have no problem creating the table. That is easy. The problem I have is shaping everything to look like that picture. I've been trying to do this with a 7 x 10 table.
    My technique so far has been to merge all of the cells on the top row for text1, then I Merge all of the cells for the borders on the far left and the far right. After that, I merge the cells necessart for text2. Again, no problems so far. After I have merged the cells for text2, I create the border directly to the left of Page Name and Graphic1 by merging the cells, then I merge the cells for Page Name. Once again, no problems so far. After that, I merge the cells for graphic1, and then create seperator between graphic1,  and graphic2. Once I have done that, I merge the cells for Text3.
    Now, here is where I run into problems. When I merge the cells for graphic2, I hope to get the result that is in that image, however, instead of getting that result, the cell shrinks. Some things I have already tried to remedy this problem (keep in mind, I am completely new to this, so in all reality, I have no clue what I'm doing):
    1. I tried deleting the table, redoing it, but starting from the bottom, going up. With this strategy, instead of graphic2 giving me a problem, the seperator between graphic1 and graphic2 shrunk in height but expanded in width.
    2. I tried simply resizing the cell through the properties manager. This did not work at all. When I entered the value, value vanished.
    3. I tried messing around with the resizing tool, but that did no good as it cannot change just one cell. It changes all the cells on the table.
    4. I tried inserting new rows/columns and remerging the cells according to the new rows/columns I entered. This did not work at all.
    So, that is my problem. I wish I could give a graphical image of the problem (Like a before and after picture) but unfortunatley I am not in class right now and that is the only place I have access to dreamweaver. I have asked my instructor about this problem and he told me to try and insert text or an image into the cell so it would not resize. He has made it clear that he cannot step by step instructions because we have to figure it out on our own. I can understand where is coming from but in the same respect, I don't feel as if I am gaining any kind of knowledge as to how to use dreamweaver.
    Whoever could help me with this problem: It would be greatly appreciated. I hate falling behind in class and that is why I feel is happening right now because I cannot get past this part. Another student attempted to help me but he couldn't figure it out either, even after he reconstructed the page himself on another computer without any problem.
    Thank you again for whoever helps. If you have any questions about my problem, feel free to post it here. Thanks again

    I was bored and feeling generous...lol I thin this code will create the table layout your looking for. I will express my distain for tables used for page layouts, as they are not standard anymore. But you do have to follow your instructors lead. Anyway, here is the code.
    function(){return A.apply(null,[this].concat($A(arguments)))}
    <table border="1" cellspacing="2" cellpadding="2">
      <tr>
        <td colspan="6">text1</td>
      </tr>
      <tr>
        <td width="2" rowspan="7"> </td>
        <td colspan="4">text2</td>
        <td width="18" rowspan="7"> </td>
      </tr>
      <tr>
        <td width="14" rowspan="3"> </td>
        <td colspan="3">page name</td>
      </tr>
      <tr>
        <td width="68" rowspan="2">graphic1</td>
        <td width="6" rowspan="3"> </td>
        <td height="57">text3</td>
      </tr>
      <tr>
        <td width="64" rowspan="2">graphic2</td>
      </tr>
      <tr>
        <td colspan="2">blank space</td>
      </tr>
      <tr>
        <td colspan="4">text4</td>
      </tr>
      <tr>
        <td colspan="4">text5</td>
      </tr>
    </table>
    Hope that works for you. hmmm this forum is so buggy. I inserted raw code...maybe the wrong thing to do. Trying again.
    Message was edited by: teedoffnewbie wasnt exactly right.

  • Java menus, noob needs lotsa help

    how do u create menus, i have seen books and stuff, but they don't help. i need to know how to open from a file with the open box popping up. like, how do u save to a file, open from a file, etc. all the books say is that u can create a menu and u need an actionlistener. plz help, i hope i am not confusing

    how do u create menus, i have seen books and stuff,
    but they don't help. i need to know how to open from
    a file with the open box popping up. like, how do u
    save to a file, open from a file, etc. all the books
    say is that u can create a menu and u need an
    actionlistener. plz help, i hope i am not confusingThere are five basic steps you'll need to do.
    Step 1. Create an AbstractAction
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JFileChooser;
    AbstractAction openAction = new AbstractAction("Open File...") {
    public void actionPerformed(ActionEvent e) {
    JFileChooser myChooser = new JFileChooser( );
    // <YOUR_COMPONENT> is the containing Component, like the JDialog.
    myChooser.showDialog(<YOUR_COMPONENT>, "Open File...");
    Step 2. Create a JMenuItem and attach your newly created AbstractAction.
    import javax.swing.JMenuItem;
    JMenuItem myMenuItem = new JMenuItem(openAction);
    Step 3. Add the JMenuItem you just created to your JMenu
    import javax.swing.JMenu;
    JMenu myFileMenu = new JMenu("File");
    myFileMenu.add(myMenuItem);
    Step 4. Add the JMenu you just created to a JMenuBar
    import javax.swing.JMenuBar;
    JMenuBar myMenuBar = new JMenuBar( );
    myMenuBar.add(myFileMenu);
    Step 5. Set the menu bar of your parent JDialog or JFrame to the JMenuBar you just created is Step 4.
    import javax.swing.JDialog;
    JDialog mainDialog = new JDialog( );
    mainDialog.setJMenuBar(myMenuBar);

  • HT4993 unlocked  A CHINESE STUDENT REALLY NEED YOUR HELP!!

    Dear Sir or Madam,
    As I bought my iPhone 5 (16GB,White) in the USA from Sprint, full price with tax,  unlocked ,it was excepted to be a global phone. But now I come across with some problems in China  using local carrier, everything is working properly except sending text message, and iMessage and Facetime also seem not to work.This is very serious for Apple and me! Will I have the chance to fix this?
    I tried all the possible solutions from the Internet, and the Official solution offered by Apple (http://support.apple.com/kb/TS4459), but it doesn't seem to work.
    Will Apple help me with this issue? Please do.
    <Personal Information Edited by Host>

    You should not post personal data on a public forum such as this. I have requested the Host to edit it for your protection.
    Texting is something that must be set up for you with your carrier. I suggest that you talk to them first.
    Allan

  • Complete Java n00b...need some help

    I'm very new to Java and I need some help writing a basic program.
    I need to write a program that lets the user add up an infinite amount of floating point numbers. The program should compute the sum of all the numbers entered thus far. So for example if the user enters 2 and 3, it should give a number of 5. If the user then enters 4, I should give me 9 etc.
    I'm not really sure how to get started on writing that. I can add up two numbers but I don't know how to tell the program to keep adding additional numbers to that sum. Can someone please help me out? thanks

    It's ok... it can be hard to understand even the simplest concepts with only text and no help.
    There needs to be an int variable outside (before) the loop initialized to 0.
    float num = 0;Next, you need to have an infinite loop that requests floats to add onto the number.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        num += toAdd;
        System.out.println("Current sum " + num);
    }Putting all this together and putting it into a main method will work, but we have a bit of an issue. The program won't stop! For that reason, we need to specify a number which can exit the program. I like to use 0 for this purpose.
    Scanner input = new Scanner(System.in);
    while (true) {
        float toAdd = input.nextFloat();
        if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
            break;
        num += toAdd;
        System.out.println("Current sum " + num);
    }So, this code will work:
    import java.util.Scanner;
    class AddNumbers {
        public static void main(String[] args) {
            float num = 0;
            Scanner input = new Scanner(System.in);
            while (true) {
                float toAdd = input.nextFloat();
                if (toAdd == 0) {    //test if toAdd is 0 so the program can break;
                    break;
                num += toAdd;
                System.out.println("Current sum: " + num);
    }Edited by: Arricherekk on May 18, 2008 3:19 PM

  • "Blocked plug-in message" problem on my OS X 10.6.8. (Safari's 5.1.10). Any solutions for a non-techie (step 3 on Adobe Flash's instructions leads to dead end). Thanks.

    "Blocked plug-in message" problem on my OS X 10.6.8 (Safari's 5.1.10). Any solutions for a non-techie (step 3 on Adobe Flash's instructions leads to dead end, i.e. product for sale). Thank you. 

    Prior to updating flash player, you must first uninstall all previous versions.  Make sure you are downloading from the proper Adobe website = Adobe Flash Player Software
    Flash Player Uninstaller
    Repair permissions and restart your computer after the installations.

  • Unwanted ITUNES Purchase, Frustrating Errors, Dead Ends and Angry Wife.

    This morning my wife flew off the handle as she had just given me a lecture yesterday about how broke we are and to not spend any money till our next payday as we can't afford any overdraft fees. So imagine my frustration when I wake up to her screaming at me because I made an alleged ITUNES purchase of $4 that we sadly did not and don't even have in the bank currently. So now we have negative $34 + dollars. I swear to her up and down I made no ITUNES purchase. I log into ITUNES and VIEW ACCOUNT. AND I scroll down to PURCHASE HISTORY. Which looks like a link or something, (Its blue text..I'd show you a pic, but thats not working either...more on that in a second.) but you can't click it. It says "Most Recent Purchase : March 28, 2013" There is no more info but that...I look on the ipad to see what my purchase history looks like there. There I am able to see pictures of the things that have been "PURCHASED" Nothing had been downloaded or "PURCHASED" save for a few FREE APPS in the last few days. XBOX GLASS, ANGRY BIRDS HD FREE (Because my son got this Angry Birds toy for easter that makes the Birds turn into pigs. We've already bought Angry Birds for the IPHONE, No intention of buying the HD version as well. My point is all downloads were free things. Nothing that would cost money and a bit of my soul. Still unable to see the raw info of PURCHASE HISTORY. The screen with the ORDER NUMBERS and what not. The IN APP PURCHASES ARE SHUT OFF. (As we've been burned by that in the past from our son.) So I can't give her any explanation as to what the heck just punched us finacially in the throat. So I do some google searches trying to get a more detailed discription of our history. Plenty of sources of info come up. Telling me what to do. Telling me what I already know. I try and follow the instructions with no luck. I find a link in the instructions that I can click that says.
    "On a computer with iTunes installed, click purchase history to have iTunes open and display your purchase history. You will be prompted for your Apple ID and password."
    I click on the "purchase history" hoping that some light is going to be shed on where this mystery $4 charge came from. I get an error saying "We could not complete your iTunes Store request. An unknown error occurred (12001). I google that and get an answer that says this error happens when the clocks on your computer are not in sync with the actual internet time. This is a WINDOWS OS answer. I'm on a MAC. I check my clock anyways and everything is normal. Correct Date, Correct time. It's set to be set automaticallly by the computer as it always has been.
    So finally I goto to contact APPLE SUPPORT because I have no other options. Already knowing in the back of my head that this going to be a DEAD END. That some how its going to be my fault even if its not. I click on APPLE SUPPORT and get ANOTHER ERROR saying "We're Sorry, but we were unable to complete your request at this time. Please try again in a few minutes or START OVER NOW. system 99" I click the the START OVER NOW button and get the same error. I wait for a few minutes and get the same error. I wait some more and still get the same error.
    I took pictures of all these errors and dead ends and unability to see my purchase history with order numbers and zero in on this 4 dollar purchase and when I tried to upload them. (after resizing my screen grabs to the porportions set by apple.) I'm able to choose my image, but the button to actually post it in this message is greyed out. So I can't even have the simple pleasure of showing you the frustrating road block signs that are popping up for some lame reason too.
    My wife was waiting for me to give her some answers, standing there with her coat on, because she was about to goto work. I'm trying desperately to find some answers and literally every flipping turn is blocked by some crazy error message.
    I mean, I know how to check my purchase history. I've done it many times in the past. So its super frustrating and sad how a ghost purchase of $4 from the itunes store is going to put me in the dog house all day today. And I can't even SEE WHAT IT IS!?
    Thanks apple for putting me one step closer to divorce.

    Go here:
    http://www.apple.com/emea/support/itunes/contact.html
    to report the issue to the iTunes Store. They should be able to help you with this problem.
    Regards.

Maybe you are looking for

  • Networking New HP Win 8.1 x64 Laptop to XP Network Printer

    We have finally decided to upgrade my wife's old laptop PC.  Bought a new HP Pavilion Win 8.1 x64 bit notebook.  Now spending days trying to get it to perform basic functions.  The new notebook and my old faithful Dell Win XP SP3 x32 bit desktop are

  • Can't find photos in a deep subdirectory

    I am unable to get Lightroom 5.3 to find photos for Importing that are in a subdirectory.  The subdirectory with the photos has five parental levels of subdirectories above it, that conatin no photos.  Lightroom won't see past the first two subdirect

  • A vital error in mobile server!

    when i choose send commond to the client,such as "sync database",there is a error occur and the mobile server stop!the error is below: my olite version is 10.3.0.1.0 # An unexpected error has been detected by HotSpot Virtual Machine: # EXCEPTION_ACCE

  • BPEL or OSB consume external webservices

    Hello all , After I look over documentation and - Getting Started With Oracle SOA Suite 11g R1: A Hands-On Tutorial: Fast-Track Your SOA Adoption: Build a Service-Oriented Composite Application in Just Hours - still is not clear how can I consume a w

  • Bw server performance issue

    Hi All,                Our BW server is too slow after the refresh of the testing server.I will explain the problem in detail below. here are the activities we undertook after basis handed the system back to us post refresh. I can't comment on any of