On minimizing application,the components of the frame become unordered

Hi all,
On minimizing application,the components of the frame become unordered in Swings.Can anyone suggest wat to do?
Regards,
Mansi

Please do not cross-post questions in multiple forums. This will frustrate anyone who tries to help you only to find out later that the same answer was given hours ago in a cross-posted thread. For this reason, many volunteers here and at the other sites refuse to help repeat offenders. Also, your not replying to posts in the previous thread before posting here suggests that you aren't reading the suggestions, so why should we bother putting in any effort to help you if you don't demonstrate that its worth our doing so?
[http://forums.sun.com/thread.jspa?threadID=5333175]

Similar Messages

  • I have made a book of my I Photo pictures. In certain layouts there is a textframe. How can I avoid the frame becoming visible in the print if I don't want to write anything? Should I just leave it or should I delete the text "Write your text here" ?

    I have made a book of my iPhoto pictures. In certain layouts there is a text frame. How can I avoid the frame becoming visible in the print if I don't want to write anything?  Should I just leave it untouched or should I delete the instructing text "Write your text here"?

    Most pages have layouts for pictures only or pictures with text boxes. Either select the same layout for that page but the one without the text box or put a space in the text box.
    Putting a space in the text box will avoid getting the warning when ordering that there's an unfilled text box in the book. The box will not be visible in the final product.  You can and should check the book before ordering by previewing it as described in this Apple document: iPhoto '11: Preview a book, card, or calendar before you order or print it
    Happy Holidays

  • How to get the frame rate of my application

    Hi again...
    How can I get the frame rate of my application?
    I also want the frame rate value to be the title of the frame, updated every second. How do I do that?
    thanks in advance...

    To get the path where your application has been installed you have to do the following:
    have a class called "what_ever" in the folder.
    then you do a litte:
    String path=
    what_ever.class.getRessource("what_ever.class").toString()
    That get you a string like:
    file:/C:/Program Files/Cool_program/what_ever.class
    Then you process the result a little to remove anything you don't want:
    path=path.substring(path.indexOf('/')+1),path.lastIndexOf('/'))
    //Might be a little error here but you should find out //quickly if it's the case
    And here you go, you have a nice
    C:/Program Files/Cool_program
    which is the path to your application.
    Hooray

  • My computer had to be wiped clean and I had to reinstall my Photoshop Elements 5.  I keep getting this message:  The Adobe Updater could not be started.  Please reinstall the application and components.

    My computer had to be wiped clean and I had to reinstall my Photoshop Elements 5.  I keep getting this message:  The Adobe Updater could not be started.  Please reinstall the application and components.
    I need to take care of this. I have reinstalled it 3 times and still get the same message.
    Any suggestions?

    Firefox is trying to update but it can't because Firefox is running
    Open the task manager with Ctrl + Alt + delete. Click on the Processes tab and find firefox.exe. Click End process

  • Problem with dragged component after resizing the frame

    My application is simple: I am displaying an image on a panel inside a frame (JFrame). I am able to drag the image inside the panel. My problem is that, after dragging the image around, if I am resizing the frame, the image goes back to its original position.
    Does anyone know a workaround?
    I have been using the sample provided by noah in his answer (reply no. 3) to a previous question on this forum: http://forum.java.sun.com/thread.jsp?forum=57&thread=126148
    Thank you!

    Chek out the visibility of your components. Some operations may render them invisible. Use the setVisible( boolean ) to make them visible.

  • How to access the handle of  the Frame window ?

    How to access the handle of the frame window through out the application ?. I want to display an alert box, while I click the fifth inner child component of the Frame . I am using Dialog Class for the alert box, I have to pass the frame handle to the Dialog constructer, I am getting the handle of the frame by getParent().getParent()......getParent().. But can any one suggest any better solution.

    If you application extends Frame or JFrame, you could simply refer to "this", or if you create a global or final Frame object that you use as your "top-level" component, you could refer to it this way. Additionally, if you're ever in a situation where you really need to go all the way to the top through n levels of components, I believe you could always do something like this...
    // assume myContainer is the "child" component that you're on, and you want to find its top-level parent
    Container c = myContainer;
    while (c.getParent() != null) {
         c = c.getParent();
    }

  • Anybody knows how to bounce them off the edge of the frame ...

    I want them to change position randomly and smothly and also bounce off the edge of the frame. i will be so happy if you can help me.
    Here is the code:
    FlatWorld:
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    * This FlatWorld contains random number(between 1 and 10) of disks
    * that can be drawn on a canvas.
    public class FlatWorld
        // initialize the width and height of the Canvas in FlatWorld...
        final int WIDTH = 400;
        final int HEIGHT = 400;
        // create random numbers of disks (1-10) using array.
        Random myRandom = new Random();
        int numbersOfDisks = myRandom.nextInt(10) + 1;
        Disk myDisk[] = new Disk[numbersOfDisks];
        // The Canvas on which things can be drawn or painted...
        private Canvas myCanvas;
        * creates a Canvas and disks
       FlatWorld()
            //Creates our disks using array.
            for( int i = 0; i < numbersOfDisks; i++ )
                myDisk[i] = new Disk(WIDTH,HEIGHT);
            //creates a canvas and store it in the instance variable...
            myCanvas = new Canvas(WIDTH,HEIGHT,this);
       /* Draws our disks using array.
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawYourself(Graphics graphicsContext)
            for (int i = 0; i < numbersOfDisks; i++)
                myDisk.drawDisk(graphicsContext);
    public void change()
    final int movementScale = 8;
    for (int i = 0; i < numbersOfDisks; i++)
    int deltax = (int)( Math.random() - 0.5 * movementScale );
    int deltay = (int)( Math.random() - 0.5 * movementScale );
    myDisk[i].move(deltax, deltay);
    Disk:
    import java.awt.*;
    import java.util.*;
    * The Disk class is used to creates a disk with a random position
    * and a random color and a random diameter (between 1/20 width and 1/4 width)
    public class Disk
        /* instance variables */                    
        private int x;
        private int y;
        private int Diameter;
        private Color randomColor;
        private int red, green, blue;
         * Constructor for objects of class Disk
        //creat a disk at a 2D random position between width and height
        public Disk(int width, int height)
            /* Generates a random color red, green, blue mix. */
            red =(int)(Math.random()*256);
            green =(int)(Math.random()*256);
            blue =(int)(Math.random()*256);
            randomColor = new Color (red,green,blue);
            /* Generates a random diameter between 1/20 and 1/4 the width of the world. */
            double myRandom = Math.random();
            Diameter = (width/20) + (int)(( width/4 - width/20 )*myRandom);
            /* Generates a random xy-offset.
             * If the initial values of the xy coordinates cause the disk to draw out of the boundry,
             * then the x and/or y will change their values in order to make the whole disk visible in
             * the boundry. */
            int randomX = (int)(Math.random() * width);
            int randomY = (int)(Math.random() * height);
            int endPointX = randomX + Diameter;
            int xPixelsOutBound = endPointX - width;
            if ( endPointX > width)
                randomX = randomX - xPixelsOutBound;
            int endPointY = randomY + Diameter;
            int yPixelsOutBound = endPointY - width;
            if ( endPointY > width)
                randomY = randomY - yPixelsOutBound;
            setXY(randomX , randomY);
            /* replace values of newX and newY (randomX and randomY) into the x and y variables
             * @param newX The x-position of the disk
             * @param newY The y-position of the disk */
            public void setXY( int newX, int newY )
                x = newX;
                y = newY;
            /* Draw a disk by its coordinates, color and diameter...
             * @param graphicsContext The Graphics context required to do the drawing.
             * Supplies methods like "setColor" and "fillOval". */
            public void drawDisk(Graphics graphicsContext)
                graphicsContext.setColor(randomColor);
                graphicsContext.fillOval( x , y, Diameter , Diameter );
            public void move (int deltaX, int deltaY)
                x = x + deltaX;
                y = y + deltaY;
    }[i]Canvas:import java.awt.*;
    import javax.swing.*;
    public class Canvas extends JPanel
    // A reference to the Frame in which this panel will be displayed.
    private JFrame myFrame;
    // The FlatWorld on which disks can be create...
    FlatWorld myFlatWorld;
    * Initialize the Canvas and attach a Frame to it.
    * @param width The width of the Canvas in pixels
    * @param height The height of the Canvas in pixels
    public Canvas(int width, int height, FlatWorld sourceOfObjects)
    myFlatWorld = sourceOfObjects;
    // Set the size of the panel. Note that "setPreferredSize" requires
    // a "Dimension" object as a parameter...which we create and initialize...
    this.setPreferredSize(new Dimension(width,height));
    // Build the Frame in which this panel will be placed, and then place this
    // panel into the "ContentPane"....
    myFrame = new JFrame();
    myFrame.setContentPane(this);
    // Apply the JFrame "pack" algorithm to properly size the JFrame around
    // the panel it now contains, and then display (ie "show") the frame...
    myFrame.pack();
    myFrame.show();
    * Paint is automatically called by the Java "swing" components when it is time
    * to display or "paint" the surface of the Canvas. We add whatever code we need
    * to do the drawing we want to do...
    * @param graphics The Graphics context required to do the drawing. Supplies methods
    * like "setColor" and "fillOval".
    public void paint(Graphics graphics)
    // Clears the previous drawing canvas by filling it with the background color(white).
    graphics.clearRect( 0, 0, myFlatWorld.WIDTH, myFlatWorld.HEIGHT );
    // paint myFlatWorld
    myFlatWorld.drawYourself(graphics);
    //try but if --> {pauses the program for 100 miliseconds} dont work -->
    try {Thread.sleep(70);}
         catch (Exception e) {}
         myFlatWorld.change();
         repaint();

    Here is my contribution:
    FlatWorld:
    import java.awt.*;
    import javax.swing.*;
    import java.util.*;
    * This FlatWorld contains random number(between 1 and 10) of disks
    * that can be drawn on a canvas.
    public class FlatWorld {
       // initialize the width and height of the Canvas in FlatWorld...
       final int WIDTH = 400;
       final int HEIGHT = 400;
       // create random numbers of disks (1-10) using array.
       Random myRandom = new Random();
       int numbersOfDisks = myRandom.nextInt(10) + 1;
       FlatWorldDisk myDisk[] = new FlatWorldDisk[numbersOfDisks];
       // The Canvas on which things can be drawn or painted...
       private FlatWorldCanvas myCanvas;
        * creates a Canvas and disks
       public FlatWorld() {       
            //Creates our disks using array.
            for( int i = 0; i < numbersOfDisks; i++ ) {
                myDisk[i] = new FlatWorldDisk(WIDTH,HEIGHT);
            //creates a canvas and store it in the instance variable...
            myCanvas = new FlatWorldCanvas(WIDTH,HEIGHT,this);
       /* Draws our disks using array.
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawYourself(Graphics graphicsContext) {
            for (int i = 0; i < numbersOfDisks; i++) {
                myDisk.drawDisk(graphicsContext);
    public void change() {
    final int movementScale = 8;
    for (int i = 0; i < numbersOfDisks; i++) {
    int deltax = (int)( Math.random() - 0.5 * movementScale );
    int deltay = (int)( Math.random() - 0.5 * movementScale );
    myDisk[i].move(deltax, deltay, WIDTH, HEIGHT);
    public static void main(String[] args) {
    new FlatWorld();
    FlatWorldDisk:
    import java.awt.*;
    import java.util.*;
    * The FlatWorldDisk class is used to creates a disk with a random position
    * and a random color and a random diameter (between 1/20 width and 1/4 width)
    public class FlatWorldDisk {
       /* Constants */
       private static final int DIRECTION_NW = 1;
       private static final int DIRECTION_N  = 2;
       private static final int DIRECTION_NE = 3;
       private static final int DIRECTION_W  = 4;
       private static final int DIRECTION_E  = 5;
       private static final int DIRECTION_SW = 6;
       private static final int DIRECTION_S  = 7;
       private static final int DIRECTION_SE = 8;
       /* instance variables */               
       private int x;
       private int y;
       private int diameter;
       private Color randomColor;
       private int red, green, blue;
       private int direction;
        * Constructor for objects of class FlatWorldDisk
       //creat a disk at a 2D random position between width and height
       public FlatWorldDisk(int width, int height) {
          /* Generates a random color red, green, blue mix. */
          red =(int)(Math.random()*256);
          green =(int)(Math.random()*256);
          blue =(int)(Math.random()*256);
          randomColor = new Color (red,green,blue);
          /* Generates a random diameter between 1/20 and 1/4 the width of the world. */
          double myRandom = Math.random();
          diameter = (width/20) + (int)(( width/4 - width/20 )*myRandom);
          /* Generates a random xy-offset.
           * If the initial values of the xy coordinates cause the disk to draw out of the boundry,
           * then the x and/or y will change their values in order to make the whole disk visible in
           * the boundry. */
          int randomX = (int)(Math.random() * width);
          int randomY = (int)(Math.random() * height);
          int endPointX = randomX + diameter;
          int xPixelsOutBound = endPointX - width;
          if (endPointX > width) randomX = randomX - xPixelsOutBound;
          int endPointY = randomY + diameter;
          int yPixelsOutBound = endPointY - width;
          if (endPointY > width) randomY = randomY - yPixelsOutBound;
          setXY(randomX , randomY);
          /* Generates a random direction */
          direction = (int)(Math.random() * 8) + 1;
       /* replace values of newX and newY (randomX and randomY) into the x and y variables
        * @param newX The x-position of the disk
        * @param newY The y-position of the disk */
       public void setXY(int newX, int newY) {
          x = newX;
          y = newY;
       /* Draw a disk by its coordinates, color and diameter...
        * @param graphicsContext The Graphics context required to do the drawing.
        * Supplies methods like "setColor" and "fillOval". */
       public void drawDisk(Graphics graphicsContext) {
          graphicsContext.setColor(randomColor);
          graphicsContext.fillOval( x , y, diameter , diameter );
       public void move(int deltaX, int deltaY,
                        int width, int height) {
          int dx = Math.abs(deltaX);
          int dy = Math.abs(deltaY);
          int olddir = direction;
          int newdir = olddir;
          switch(olddir) {
             case DIRECTION_NW: { int newX = x - dx, newY = y - dy;
                                  if ((newX < 0) && ((y - dy) < 0))         newdir = DIRECTION_SE;
                                  else if (((newX) >= 0) && ((y - dy) < 0)) newdir = DIRECTION_SW;
                                  else if (((newX) < 0) && ((y - dy) >= 0)) newdir = DIRECTION_NE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_N:  { int newY = y - dy;
                                  if ((newY) < 0) newdir = DIRECTION_S;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     y =newY;
                                  break;
             case DIRECTION_NE: { int newX = x + dx, newY = y - dy;
                                  if (((newX + diameter) > width) && (newY < 0))       newdir = DIRECTION_SW;
                                  else if (((newX + diameter) > width) && (newY >= 0)) newdir = DIRECTION_NW;
                                  else if (newY < 0)                                   newdir = DIRECTION_SE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_W:  { int newX = x - dx;
                                  if (newX < 0) newdir = DIRECTION_E;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX;
                                  break;
             case DIRECTION_E:  { int newX = x + dx;
                                  if (newX + diameter > width) newdir = DIRECTION_W;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX;
                                  break;
             case DIRECTION_SW: { int newX = x - dx, newY = y + dy;
                                  if ((newX < 0) && ((newY + diameter) > height))     newdir = DIRECTION_NE;
                                  else if (newX <0)                                   newdir = DIRECTION_SE;
                                  else if ((newY + diameter) > height)                newdir = DIRECTION_NW;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
             case DIRECTION_S:  { int newY = y + dy;
                                  if ((newY + diameter) > height) newdir = DIRECTION_N;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     y =newY;
                                  break;
             case DIRECTION_SE: { int newX = x + dx, newY = y + dy;
                                  if (((newX + diameter) > width) && ((newY + diameter) > height)) newdir = DIRECTION_NW;
                                  else if ((newX + diameter) > width)                              newdir = DIRECTION_SW;
                                  else if ((newY + diameter) > height)                             newdir = DIRECTION_NE;
                                  if (newdir != olddir) {
                                     direction = newdir;
                                     move(deltaX, deltaY, width, height);
                                  else {
                                     x = newX; y = newY;
                                  break;
    FlatWorldCanvas remains unchanged.
    Hope this will help,
    Regards.

  • How do I set the frame size

    I am Making a program for purchasing games, with the basic layout alsot done, except on problem. When the purchase button is pressed, a dialog shows up but nothing is seen until i resize it. How would i set the frame size so that i do not need to resize it each time? below is the code for the files. Many thanks in advance.
    CreditDialog
    import java.awt.*;
    import java.awt.event.*;
    class CreditDialog extends Dialog implements ActionListener { // Begin Class
         private Label creditLabel = new Label("Message space here",Label.RIGHT);
         private String creditMessage;
         private TextField remove = new TextField(20);
         private Button okButton = new Button("OK");
         public CreditDialog(Frame frameIn, String message) { // Begin Public
              super(frameIn); // call the constructor of dialog
              creditLabel.setText(message);
              add("North",creditLabel);
              add("Center",remove);
              add("South",okButton);
              okButton.addActionListener(this);
              setLocation(150,150); // set the location of the dialog box
              setVisible(true); // make the dialog box visible
         } // End Public
         public void actionPerformed(ActionEvent e) { // Begin actionPerformed
    //          dispose(); // close dialog box
         } // End actionPerformed
    } // End Class
    MobileGame
    import java.awt.*;
    import java.awt.event.*;
    class MobileGame extends Panel implements ActionListener { // Begin Class
         The Buttons, Labels, TextFields, TextArea 
         and Panels will be created first.         
         private int noOfGames;
    //     private GameList list;
         private Panel topPanel = new Panel();
         private Panel middlePanel = new Panel();
         private Panel bottomPanel = new Panel();
         private Label saleLabel = new Label ("Java Games For Sale",Label.RIGHT);
         private TextArea saleArea = new TextArea(7, 25);
         private Button addButton = new Button("Add to Basket");
         private TextField add = new TextField(3);
         private Label currentLabel = new Label ("Java Games For Sale",Label.RIGHT);
         private TextArea currentArea = new TextArea(3, 25);
         private Button removeButton = new Button("Remove from Basket");
         private TextField remove = new TextField(3);
         private Button purchaseButton = new Button("Purchase");
         private ObjectList gameList = new ObjectList(20);
         Frame parentFrame; //needed to associate with dialog
         All the above will be added to the interface 
         so that they are visible to the user.        
         public MobileGame (Frame frameIn) { // Begin Constructor
              parentFrame = frameIn;
              topPanel.add(saleLabel);
              topPanel.add(saleArea);
              topPanel.add(addButton);
              topPanel.add(add);
              middlePanel.add(currentLabel);
              middlePanel.add(currentArea);
              bottomPanel.add(removeButton);
              bottomPanel.add(remove);
              bottomPanel.add(purchaseButton);
              this.add("North", topPanel);
              this.add("Center", middlePanel);
              this.add("South", bottomPanel);
              addButton.addActionListener(this);
              removeButton.addActionListener(this);
              purchaseButton.addActionListener(this);
              The following line of code below is 
              needed inorder for the games to be  
              loaded into the SaleArea            
         } // End Constructor
         All the operations which will be performed are  
         going to be written below. This includes the    
         Add, Remove and Purchase.                       
         public void actionPerformed (ActionEvent e) { // Begin actionPerformed
         If the Add to Basket Button is pressed, a       
         suitable message will appear to say if the game 
         was successfully added or not. If not, an       
         ErrorDialog box will appear stateing the error. 
              if(e.getSource() == addButton) { // Begin Add to Basket
    //          GameFileHandler.readRecords(list);
                   try { // Begin Try
                        String gameEntered = add.getText();
                        if (gameEntered.length() == 0 ) {
                             new ErrorDialog (parentFrame,"Feild Blank");
                        } else if (Integer.parseInt(gameEntered)< 0
                                  || Integer.parseInt(gameEntered)>noOfGames) { // Begin Else If
                             new ErrorDialog (parentFrame,"Invalid Game Number");
                        } else { // Begin Else If
                             //ADD GAME
                        } // End Else
                   } catch (NumberFormatException num) { // Begin Catch
                        new ErrorDialog(parentFrame,"Please enter an Integer only");
                   } // End Catch
              } // End Add to Basket
         If the Remove From Basket Button is pressed, a  
         a suitable message will appear to say if the    
         removal was successful or not. If not, an       
         ErrorDialog box will appear stateing the error. 
         if(e.getSource() == removeButton) { // Begin Remove from Basket
              try { // Begin Try
                        String gameEntered = remove.getText();
                        if (gameEntered.length() == 0 ) {
                             new ErrorDialog (parentFrame,"Feild Blank");
                        } else if (Integer.parseInt(gameEntered)< 1
                                  || Integer.parseInt(gameEntered)>noOfGames) { // Begin Else If
                             new ErrorDialog (parentFrame,"Invalid Game Number");
                        } else { // Begin Else If
                             //ADD GAME CODE
                        } // End Else
                   } catch (NumberFormatException num) { // Begin Catch
                        new ErrorDialog(parentFrame,"Please enter an Integer only");
                   } // End Catch
              } // End Remove from Basket
         If the purchase button is pressed, the          
         following is executed. NOTE: nothing is done    
         when the ok button is pressed, the window       
         just closes.                                    
              if(e.getSource() == purchaseButton) { // Begin Purchase
                   String gameEntered = currentArea.getText();
                   if (gameEntered.length() == 0 ) {
                        new ErrorDialog (parentFrame,"Nothing to Purchase");
                   } else { // Begin Else If
                        new CreditDialog(parentFrame,"Cost � 00.00. Please enter Credit Card Number");
                   } // End Else               
              } // End Purchase
         } // End actionPerformed
    } // End Class
    RunMobileGame
    import java.awt.*;
    public class RunMobileGame { // Begin Class
         public static void main (String[] args) { // Begin Main
              EasyFrame frame = new EasyFrame();
              frame.setTitle("Game Purchase for 3G Mobile Phone");
              MobileGame purchase = new MobileGame(frame); //need frame for dialog
              frame.setSize(500,300); // sets frame size
              frame.setBackground(Color.lightGray); // sets frame colour
              frame.add(purchase); // adds frame
              frame.setVisible(true); // makes the frame visible
         } // End Main
    } // End Class
    EasyFrame
    import java.awt.*;
    import java.awt.event.*;
    public class EasyFrame extends Frame implements WindowListener {
    public EasyFrame()
    addWindowListener(this);
    public EasyFrame(String msg)
    super(msg);
    addWindowListener(this);
    public void windowClosing(WindowEvent e)
    dispose();
    public void windowDeactivated(WindowEvent e)
    public void windowActivated(WindowEvent e)
    public void windowDeiconified(WindowEvent e)
    public void windowIconified(WindowEvent e)
    public void windowClosed(WindowEvent e)
    System.exit(0);
    public void windowOpened(WindowEvent e)
    } // end EasyFrame class
    ObjectList
    class ObjectList
    private Object[] object ;
    private int total ;
    public ObjectList(int sizeIn)
    object = new Object[sizeIn];
    total = 0;
    public boolean add(Object objectIn)
    if(!isFull())
    object[total] = objectIn;
    total++;
    return true;
    else
    return false;
    public boolean isEmpty()
    if(total==0)
    return true;
    else
    return false;
    public boolean isFull()
    if(total==object.length)
    return true;
    else
    return false;
    public Object getObject(int i)
    return object[i-1];
    public int getTotal()
    return total;
    public boolean remove(int numberIn)
    // check that a valid index has been supplied
    if(numberIn >= 1 && numberIn <= total)
    {   // overwrite object by shifting following objects along
    for(int i = numberIn-1; i <= total-2; i++)
    object[i] = object[i+1];
    total--; // Decrement total number of objects
    return true;
    else // remove was unsuccessful
    return false;
    ErrorDialog
    import java.awt.*;
    import java.awt.event.*;
    class ErrorDialog extends Dialog implements ActionListener {
    private Label errorLabel = new Label("Message space here",Label.CENTER);
    private String errorMessage;
    private Button okButton = new Button("OK");
    public ErrorDialog(Frame frameIn, String message) {
    /* call the constructor of Dialog with the associated
    frame as a parameter */
    super(frameIn);
    // add the components to the Dialog
              errorLabel.setText(message);
              add("North",errorLabel);
    add("South",okButton);
    // add the ActionListener
    okButton.addActionListener(this);
    /* set the location of the dialogue window, relative to the top
    left-hand corner of the frame */
    setLocation(100,100);
    // use the pack method to automatically size the dialogue window
    pack();
    // make the dialogue visible
    setVisible(true);
    /* the actionPerformed method determines what happens
    when the okButton is pressed */
    public void actionPerformed(ActionEvent e) {
    dispose(); // no other possible action!
    } // end class
    I Know there are alot of files. Any help will be much appreciated. Once again, Many thanks in advance

    setSize (600, 200);orpack ();Kind regards,
      Levi
    PS:
        int i;
    parses to
    int i;
    , but
    [code]    int i;[code[i]]
    parses to
        int i;

  • When I hit the minimize button on Firefox to use the side by side view with Excel in Windows 7, my Firefox window gets larger and won't give me an arrow in the corner to reduce the frame size.

    I can't find a menu to resize my minimized window as it is actually larger than the normal window. The frame of firefox goes right off the screen and will not give me a corner arrow to drag it down to size. Normal window view is just fine. How do I correct this?

    It is possible that the screen is too wide or too high and that the scroll bars fall off.<br />
    Open the system menu via Alt+Space and see if you can resize that window.<br />
    If that works then close Firefox to save that setting.<br />
    See also http://kb.mozillazine.org/Resizing_oversize_window
    Window sizes and positions are stored in [http://kb.mozillazine.org/localstore.rdf localstore.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder].
    Delete localstore.rdf or rename the file to localstore.rdf.sav in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to test if the file is corrupted.<br />
    See http://kb.mozillazine.org/Corrupt_localstore.rdf<br />
    (caution: do not delete the localstore.rdf file in the Firefox program installation folder)
    Note:<br />
    Deleting the file [http://kb.mozillazine.org/localstore.rdf localstore.rdf] will reset the customizations of the toolbars to the defaults.<br />
    You can rename "localstore.rdf" to "localstore.rdf.sav" to test if that solves it.<br />
    Then you can restore the customization by copying "localstore.rdf.sav" to "localstore.rdf" if it didn't work.

  • How can I get the frame option that diffuses the edges of a picture in pages 5.2

    I recently updated to Pages 5.2 and have discovered that my favorite and most used framing option is no longer a choice.  How can I get the frame option that allowed you to diffuse the edges to soften a picture edges on 5.2? 

    That is called the vignette, and yes Apple has removed it from Pages 5 along with 100 other features.
    Pages '08/'09 should still be in your Applications/iWork folder so use that.
    Be aware that Pages 5.2 is not only short of features it is also buggy and prone to leaving you with files that won't open.
    Peter

  • How to put the current timer in the frame

    I am doing one application and i am using frame. I want to show the current time( hour and minute). But i don't know how to implement it. Please help me to solve my problem. Below is the sample code of my program. How to put the timer in the bottom part.
    //AdminMenu.java
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class AdminMenu extends JFrame{
    private JLabel lblmenu;
    private JLabel lblvideo;
    private JLabel lbladmin;
    private JButton cmdaddvideo, cmddeletevideo, cmdeditvideo;
    private JButton cmdaddadmin, cmddeleteadmin, cmdchangepass;
    private Container c;
    private GridBagLayout gdlayout;
    private GridBagConstraints gdconstraints;
    private Color colorValues[] =
    { Color.black, Color.blue, Color.red, Color.green };
    public AdminMenu()
    super("Administration Menu");
    JMenu fileMenu = new JMenu( "File" );
    fileMenu.setMnemonic( 'F' );
    JMenu openMenu = new JMenu ("Open");
    openMenu.setMnemonic('O');
    fileMenu.add( openMenu );
    JMenuItem exitItem = new JMenuItem( "Exit" );
    exitItem.setMnemonic( 'x' );
    exitItem.addActionListener(
    new ActionListener() {
    public void actionPerformed( ActionEvent event )
    System.exit( 0 );
    } // end anonymous inner class
    ); // end call to addActionListener
    fileMenu.add( exitItem );
    // create menu bar and attach it to MenuTest window
    JMenuBar bar = new JMenuBar();
    setJMenuBar( bar );
    bar.add( fileMenu );
    setSize(300,250);
    setLocation(350,200);
    this.setResizable(true);
    show();
    //---------------------- Main -------------------------------
    public static void main(String args[])
    AdminMenu app = new AdminMenu();
    app.setDefaultCloseOperation(
         JFrame.EXIT_ON_CLOSE );
    Thanks for helping me

    e.g. use a thread that invokes new Date() (every minute), format the Date with SimpleDateFormat and print the result String on a Label that you can put on your frame ...

  • Top and bottom margins to be inside the frame and form should less cluster

    Hi All,
    In my application we have created nearly 10 regions and for each region i have created sub regions with No templates. Here are the deatils below.
    I need to display two regions side by side with borders, so what i have done is
    1. Created a region as #Region Start with No template with Display point as "Page template body (1. items below region content) and Header and footer i have
    given as <table border="1"><tr><td>
    2. Followed by region as #What with Wizard region as "Page template body(1. items below region content) and nothing given under header and fotter.
    3. Followed by reagion as #Region Middle with No template with Display point as "Page template body (1. items below region content) and Header and footer i
    have as </td><td>
    4. Followed by region as #where with Wizard region as "Page template body(1. items below region content) and nothing given under header and fotter.
    5. Folowed by region as #Region End with No template with Display point as "Page template body (1. items below region content) and Header and footer i have
    given as </td></tr><tr><td>
    Simiallry followed by rest of regions by creating dummy regions and placing the <tr> and <td> in Header and Footer.
    Now users are asking me to have insde the frame and form shoul dbe less cluster.
    Can suggestiosn on this who we need to achieve.
    Thanks,
    Anoo..

    'File' > 'Page Setup' is used to alter the page margins when you need to print the email. It is not used to create a Template email nor to change the overall theme used in the Thunderbird user interface.
    To add a theme to the overall Thunderbird window, you can choose
    * either a Windows theme via Control Panel > Personalization >Theme
    * or download a theme Add-on, there is a huge range here: https://addons.mozilla.org/en-US/thunderbird/themes/
    such as : https://addons.mozilla.org/en-US/thunderbird/addon/balloons/?src=ss
    If you are looking to create a Template email, then you open a new Write message, design the email, enter a Subject so that you can easily locate the email and click on 'File > Save as > Template or click on Save button and choose 'Template' from the options. then the email is saved in the Templates folder. To use, you click on Templates folder and double click on the email to open in a new Write message. then compose and send as normal. The original email will be saved in Templates folder for reuse.

  • How Do I Rotate Content, Not the Frame

    I am in InDesign CS1.
    I need to figure out how to affect the content of a placed image, not the surrounding frame. I know how to set the rotation angle of the selected object's frame:
    set rotation angle of selection to 10
    But for the life of me, I cannot understand how to leave the frame as it is and just rotate the content. I.E., normally, if I grab the direct selection tool and click an image (hovering over the image inside the frame turns to the hand tool), I can then manipulate the content without affecting the outside frame. But I want to do this with an AppleScript.
    I also assume that if someone can open this door for me, it will then lead the way to being able to scale the content, without affecting the frame. But I cannot figure out the secret of "content" vs. "selection". Halp!
    Thank you!

    Your definitions are what I would expect, but for me, applying each version as one of these two separate scripts:
    1)
    tell application "InDesign CS"
    activate
    set rotation angle of selection to 10
    end tell
    2)
    tell application "InDesign CS"
    activate
    set absolute rotation angle of selection to 10
    end tell
    Gives me the same result. The frame rotates and the content rotates with it.
    Let me start over with my problem as that may help...
    So let's say I have a frame and it has rotation 0˚. Inside the frame I have an object rotated to 5˚.
    Applying either of those two scripts has the same result. The frame rotates to 10˚ and the content (when selected with the direct selection tool) now shows a rotation of 15˚.
    But what I want is for the frame to stay at 0˚ and the content (when selected with the direct selection tool) to show a rotation of 15˚.
    I am thinking this may be relates to the "Transform Content" and "Transformations Are Totals" preference settings. Both of which I have turned on. I know how to turn them on and off with an AppleScript, but it doesn't seem to be helping.

  • Swing , would like to print hello inside of the frame, how?

    i would like to print hello inside of the frame, how can i do that?
    import java.awt.*;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import java.awt.Toolkit;
    import java.awt.BorderLayout;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class Main extends JPanel
    implements ActionListener {
    JButton button;
    public Main() {
    super(new BorderLayout());
    button = new JButton("Click Me");
    button.setPreferredSize(new Dimension(200, 80));
    add(button, BorderLayout.CENTER);
    button.addActionListener(this);
    public void actionPerformed(ActionEvent e) {
         System.out.println("hello");
    * Create the GUI and show it. For thread safety,
    * this method should be invoked from the
    * event-dispatching thread.
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("welcome");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //Create and set up the content pane.
    JComponent newContentPane = new Main();
    newContentPane.setOpaque(true); //content panes must be opaque
    frame.setContentPane(newContentPane);
    //Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }

    Recommended lessons in this context: [Using Layout Managers|http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html] and [Painting in AWT and Swing|http://java.sun.com/products/jfc/tsc/articles/painting/]
    If the second lesson is a little heavy, look at this light version: [Performing Custom Painting|http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]
    Edited by: Andre_Uhres on Aug 24, 2008 8:34 AM

  • Let applet out without the frame of a html page?

    Hi,
    I want to run a java applet like this:
    when someone logs into a web page, the applet contained in this web page
    will come out just like a standalone application, rather than run in the frame
    of this web page, how could i get it?
    I appreciate any suggestion!
    Thanks a lot
    michael

    public void init(){
    YourClass application = new YourClass();
    Where YourClass is like that:
    import java.awt.*;
    public class YourClass extends Frame{
    getContentPane().show();
    ...

Maybe you are looking for

  • Tiger User files to new iMac via enet or backup drive?

    I'm completely new to Leopard. My new (refurb) iMac 2.66 from Apple is bundled with SL. All I want from the old Powerbook/Tiger User files are iTunes library files, images folders in Pictures and Docs. No need for needwork settings, will be going to

  • 9 Button not working properly on my N95 - help ple...

    Hello all, I'm new here and have a Nokia N95. Whenever I am texting and press the 9 button, it immediately acts like the red button you press to terminate a call, and goes to the normal screen, you then have to go back into messages and it will be th

  • Windows update borking brand new server 3 times in a row...

    Hello all, here's an interesting one for you all. our company recently deployed a new server. server 2012 r2 configuration setup all worked correctly after all was done, updates were installed, afterwards the server would have a black screen of death

  • Fillable form email issue

    I have created a fillable form and when the user fills in the fields and hits the email button only the check box fields are captured in the XML. How do I get it to include all data from the form in the XML export?

  • Illustrator unexpectedly quit

    Hi there, I had my 2012 MacBook Pro replaced by Apple owing to various issues and have since tried to install Creative Suite 6 and Google Chrome amongst other software. Creative Suite 6 installed with no problems, however Illustrator will not open. I