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;

Similar Messages

  • How do you set the frame size?

    Trying to set a frame size for 1920px X 1080px but can't see where to set this in a new project?

    Frame dimensions are a property of the sequence, not the project. A project can contain multiple sequences with different properties.
    File>New>Sequence opens a dialog where you can choose a preset or configure custom settings. Several of the preset groups have 1920x1080 options.
    Asssuming you have footage of those dimensions that you'll be using in the sequence, then you can simply create a sequence from an asset. Either drag it to the New Item button in the Project panel's lower right corner, or right-click it and select New Sequence from Clip.

  • How to set the frame size?

    Hi,
    Can some one show me how to set the frame size in this program? History: I have created a window and added a button but its to small. So I want to increase the size of the frame to at least 600X400 pixel.
    private static void showGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("ButtonDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Create and set up the content pane.
            Main newContentPane = new Main();
            newContentPane.setOpaque(true); //content panes must be opaque
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        }It would be nice if you could show me how to do it.
    Thank you very much for reading this.

    Challenger wrote:
    Simply adding
    frame.setSize(new Dimension(600,400));to the end of your code should work perfectly.Or, if you want to do it correctly, .setPreferredSize() on your frame before you .pack() it. The default layout manager for JFrame is BorderLayout, which uses the preferredSize of each component to calculate sizes during the .pack() call.

  • How do I set the default size of a new folder?

    I have finder sized the way I want for existing folders and if I do Finder > New Finder Window. These preferrences, however, do not seem to apply to new folders. Everytime I create a new folder on my desktop, and open that folder for the first time, the window size is really small and the sidebar is narrow. This is incredibally annoying. How do I set the default size for all new folders? Is there a plist file I can edit to fix this? Or an AppleScript I can run automatically in the background that fixes this? I am running Mavericks 10.9.1.

    If you use the Finder's New Finder Window command (command N) to create a new window, resize it, place it where you want, and set it for icon view or however you want it. Then close it. Closing it is what sets these as the default. That should become the default for every new Finder window you create using the new window command. But if you have lots of windows open at once and then close them, the last window you close will set a new default.
    There are lots of utilities that control Windows - their size and placement. I use one called Moom but there are many more.

  • How do I set the font size in a call out (box) tool

    How do I set the font size in a call out (box) tool ?

    Good Morning Mr. Alheit,
    Thanks for this bit of apparently obscure knowledge...  <<ctrl +e>>
      - I'll bet there is more user functions in  Adobe Acrobat 9 that I'm not
    aware of, too...
      - What reference source do your use?
    M/G

  • How Do You Set the Maximum Size of a JFrame?

    Can someone show me a quick example? The JFrame can be empty, I just want to know how to set it's maximum size. I tried using setMaximumSize() and it doesn't work for some reason but setMinimumSize() works fine.
    I tried it using a BoxLayout and even using null as a layout manager and can't get it to work. I heard that the other layout managers don't allow you to set the maximum size of a JFrame so that is why I tried it with the layouts that I did.
    I tried the following code (imported the necessary classes), but it does not work...
    public class MyFrame extends JFrame
        public MyFrame()
            super("TestFrame");
            setLayout( new BoxLayout(getContentPane(), BoxLayout.X_AXIS)  );       
            setMaximumSize( new Dimension(400,200));
            setSize(300,150);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            setVisible( true );                
    }// end class

    Reposted from
    {color:#0000ff}http://forum.java.sun.com/thread.jspa?threadID=5236259{color}
    @OP:
    When you repost a topic, please always provide a link to the previous post so people can check what suggestions were already offered (and didn't solve the problem).
    Better still, give a short summary of the advice you have already tried.
    I suggested setBackground(...) so you can see whether your MyFrame is actually occupying the entire real estate of the window. Looks as if trying it out (which I would have done for you if I'd been at home, where my JDK is) would have been too much effort for you.
    I'm pretty much a novice in Swing, but I can tell you this: setLayout controls the layout of components added to the JFrame, not the layout of the frame with respect to its parent container.
    Luck, Darryl

  • How do I set the image size in PS touch to print to my Epson printer w ithout losing any of the picture. PS Touch appears to be showing pixels and not inches, how can I covert it toshow inches?

    I am using PS Touch from my tablet . I am importinga photo from an SD card . When all editing is completed I then send it wireless from the tablet  via Epson I print to the printer. It all works great except that part of the photo at each end is cut off and does not print. I am printing on 8.5 x11 paper.
    How do I convert the image size in PSTouch frm pixels to inches?

    Epson's iPrint has always been an oddball. It will always "zoom in" on an image to print even if you have the proper dimensions and resolution set for actual print size. I think other users have reported this, at least on Android.
    You can't have PS Touch show inches instead of pixels at this time but you can use an online website to find out what you need to fit within a particular resolution. (Google "pixels to inches calculator".)

  • Formatting issues: when I open a msg, the font is sooo small you need a magnifier to read it. How can I set the font size to one I can easily read?

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    I have various formatting issues:
    a. When I open a msg from my web browser (Cablevision), the font is sooo small I need a magnifier to read it. How can I set the font to a size I can easily read?
    b. When I forward msgs, the text gets all distorted and I need to clean it up (some symbols, lots of spaces between words). How can this be fixed?
    c. When I want to tell someone about a website, I cannot type the URL in so that all they have to do is click on it. How can this be fixed?
    d. When I open messages, the text opens in a small window and covers the "Show Images" button. Why?
    == This happened
    ==
    Every time Firefox opened
    == Ever since I started using Firefox (a few months ago)
    ==
    '''Troubleshooting information'''
    I didn't find any results
    == Firefox version
    ==
    3.6.3
    == Operating system
    ==
    Windows 7
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
    == Plugins installed
    ==
    *-nphpclipbook
    *Office Plugin for Netscape Navigator
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *Default Plug-in
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.2"
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *The Hulu Desktop Plugin allows Hulu.com to integrate with the Hulu Desktop application.
    *Shockwave Flash 10.0 r45
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *iTunes Detector Plug-in
    *3.0.40624.0
    *NPWLPG
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers

    The text editor is the text area that you use on the webmail (Yahoo, Hotmail) website to create a new mail.
    You can compare that with the ''Post new message'' text area that you use to create a new post on this forum.
    Just above the text area that you use to enter the message text there is usually a button bar with buttons that allows some text formatting like Bold and Italic and can also include a button to make a clickable hyperlink.
    Check the tooltip of each button by hovering with the mouse over each button.
    Make Link - https://addons.mozilla.org/firefox/addon/142

  • How can I set the minimum size the location bar should automatically resize to

    I have moved all of my navigation buttons, location bar and tabs to be in line. This has been done to maximise the available space on screen.
    This works perfectly with two or three tabs open, but once more tabs are opened the location bar automatically shrinks to allow for more tabs and becomes unusable. I want to set the minimum size the location bar should shrink to but I do not know how to do this.
    [http://www.mediafire.com/imgbnc.php/eed5749531b3081c43186f59492500e5f089c498c0372fb6fa797b7d697826806g.jpg Screen shot displaying automatically resizing location bar]
    Any help would be appreciated.
    Thanks.

    FBZP seems to be the only way to do the minimum amout setting in standard SAP.
    You can check the BTE (Business transaction event) 00001820 for excluding the low amount items in F110. Please search SDn on how to use the BTEs.
    Regards,
    SDNer

  • How do i change the frame size in FCX?

    I create short videos for an ecom website and and need the frame/canvas size to be vertical.  It was no problem in FC7, I'd just customize the frame size in the sequence settings.  There is no option in FCX that i can find.  Someone told me that apple was telling people to use one of the standard sizes and then export it in compressor using the correct size - that makes no sense, as i need to edit the videos in a vertical format, including cropping and keyframing, to make sure that the project stays centered.  Is there really no way to create a custom frame size?  im just thinking about all of those web banner videos out there, and how they can no longer be created in final cut...

    i actually initially tried this last week (creating a 'preset' in motion), and it basically 'works' but am i able to do everything with a compound clip that i can with a project?  It seems like a strange work around and are there any downfalls to editing using this workflow?
    the one thing i cant seem to do is select all of my compound clips from an event, and batch export them or send them simultaneousy to compressor.  will i need to export each clip separately?  that will tremendously effect our workflow as we generally take a batch of 50-60 movies and batch export them overnight. 
    Also since most of the videos are shot similarly each day, we always use 'paste attributes' to apply all filters, size and movement - but i dont see anywhere to do this in FCX.  I see that i can copy and past individual attributes (a single color correction) but is it not possible to apply all of the characteristics of one clip to another?
    thanks for your help!

  • How do I set the frame rate to 12fps on my video, and it not change randomly?

    Hi, I imported a video layer from file then set the frame rate to 12fps, when I play the video it keeps changing the frame rate to random times. How do I keep it at 12fps

    Click the windows start button, then right click on computer, this will bring up a window that will tell you how much ram your system has.
    Also Start>Accessories>System Tools>System Information will give you all the details you need to know.
    As for Codec, That is an abreviation for code/decode it tells windows how to code when saving a video and how to decode when playing a video. Most formats are wrappers (avi, wmv, mov, rt) Each of these have a codec that you can choose from when saving a video, that codec then must be installed on the users computer to see that same video. Most formats come with a basic number of codecs and the creator of the video can purchase other codecs that provide better feature set.
    What the codec really does is takes the video and compresses it like a zip file then the user when playing require that codec to uncompress it.
    So each codec has its own strength and weaknesses. Some can compress more making a smaller file and perhaps inturn removes more data to get that compression and therefore has a poorer quailty video (just an example)
    I am sure you heard of a few codecs if you think about it. mpg, mp2, mp3, mp4, h.264 and so on. Mp3 is the only one I listed here that is for audio only. Yep thats right even audio uses codecs.

  • How do I set the Page size default in Adobe Reader using Window 8?

    I need to set the page size everytime I go to print from my Adobe Reader in my windows 8. Is there a way to set the page I want letter (8.5 by 11) as a default? So I do not have to do this everytime I print something?

    I can't help but wonder why Adobe doesn't respond to this - at this point there are 464 views of this item and still no answer. I have the same problem and it's a big irritation to have to set the duplex mode everytime I want to print!

  • How can I set the font size of a form field in the fdf file?

    I need to dynamically set the font size of a field to accommodate text of varying length, automatic font size won't work in this case. It seems like this can be done in the FDF but I have tried several variants without success. Could someone help out with a real example of what the syntax in the fdf should look like.
    I am using Acrobat Professional 8.1 but the created fdf will need to work with Reader also.

    I think that the font size has to be set in the form itself, not the FDF.

  • My new Firefox ver 29 always starts maximized how do i set the window size and not maximized?

    I had reinstall my Windows 7 (win 7 pro 64bit)
    so i had to reinstall firefox as well, installed ver 27 and updated it to version 29
    now when i start firefox it will start maximized and i want to set the window size when it starts,
    why the size of the window will not change and it will start maximized all the time?

    # In Firefox, type ''about:support'' into the address bar and press Enter.
    # Click the Show Folder button. A Windows Explorer window opens.
    # Right-click the Firefox taskbar icon and choose either Close All Windows or Close Window.
    # In the Windows Explorer window that opened earlier, delete the ''localstore.rdf'' file.
    # If you have Firefox pinned to the taskbar, right-click the taskbar icon, then right-click the Firefox icon in the menu that pops up and choose Properties.
    #* If you have a desktop shortcut, simply right-click it and choose Properties.
    # Click the Shortcut tab in the Properties window.
    # Make sure Run is set to "Normal window".

  • How do I set custom frame size in Premiere Pro 5.5 sequence.

    I need to set a custom frame size in Premiere Pro 5.5.
    I can't edit a preset so how do I create my own?

    If you realy feel 'lazy' or have no idea what settings to choose you can drag the clip the into the New Item icon. This will create a matching sequence.

Maybe you are looking for

  • How do I fix all of the lightboxes being open and unable to click off?

    I've built a site in Muse ans exported it as HTML and everything looks great except all of the lightboxes. It works fine in preview, however when live and in browser, all of the lightboxes are active and I can't click off of any of them. Would love a

  • Purchase order release table

    Hi, we have a purchase order release strategy defined in our company. I am trying to make a SAP query that will show the list of purchase orders that are hanging for approval. I am trying to find the table that hold the information of which purchase

  • Packages in Java

    Hi Guys, I'm new in java world, and I have some questions, if anybody can help me plz. 1- The packages in java such java.sql and so on where we can downlad it? 2- How to add these packages to work with java? Thanks

  • I have 2 iPads and neither are connecting to the store

    We already have one ipad2 and have bought another - I have set these both up in my name and same payment details but using different apple IDs and passwords.... They were both working well this morning allowing FaceTime and app purchases but both hav

  • Problème connexion PC

    Bonjour, J'espère que vous allez pouvoir m'aider à résoudre mon problème ;) Lorsque je branche mon IPhone 5 via USB sur mon PC Windows 7, un message "faire confiance à cet ordinateur" apparaît, je sélectionne "se fier" le portable se connecte et se d