Need some basic help with applets

Hey all, I've never made an applet before and I'm having a small problem. Basically, when I load my applet, the GUI comes up on a separate window (doesn't load within the applet window). Here's my code:
Here's the GUI class.
import java.awt.BorderLayout;
import java.io.File;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextPane;
import javax.swing.ListModel;
import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
public class GUI extends javax.swing.JFrame {
          //Set Look & Feel
          try {
               javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
          } catch(Exception e) {
               e.printStackTrace();
     private JButton openB;
     private JButton oddsB;
     private JScrollPane jScrollPane1;
     private JList jList1;
     private JTextField fileText;
     private Vector<String> jList1Objects;
     * Auto-generated main method to display this JFrame
     /*public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    GUI inst = new GUI();
                    inst.setLocationRelativeTo(null);
                    inst.setVisible(true);
     public GUI() {
          super();
          initGUI();
     private void initGUI() {
          try {
               setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
               getContentPane().setLayout(null);
                    //Text field for file entry
                    fileText = new JTextField();
                    getContentPane().add(fileText);
                    fileText.setBounds(0, 0, 279, 25);
                    //Scroll Pane and jList1
                    jScrollPane1 = new JScrollPane();
                    getContentPane().add(jScrollPane1);
                    jScrollPane1.setBounds(0, 25, 150, 328);
                         jList1Objects = new Vector<String>();
                         jList1 = new JList(jList1Objects);
                         jScrollPane1.setViewportView(jList1);
                    //Open button and Odds button
                    openB = new JButton();
                    oddsB = new JButton();
                    getContentPane().add(oddsB);
                    getContentPane().add(openB);
                    oddsB.setText("Calculate Odds");
                    oddsB.setBounds(679, 109, 105, 353);
                    openB.setText("Open File");
                    openB.setBounds(279, 0, 99, 25);
                    //Open Button action
                    openB.addActionListener(new java.awt.event.ActionListener() {
                         public void actionPerformed(java.awt.event.ActionEvent evt) {
                              //Opens up hand history file to be read in
                              JFileChooser fc = new JFileChooser();
                              fc.setCurrentDirectory(new File("C:\\Program Files\\Full Tilt Poker\\HandHistory"));
                              int returnVal = fc.showOpenDialog(getContentPane());     
                              if(returnVal == JFileChooser.APPROVE_OPTION) {
                                   //Display file in text box
                                   fileText.setText(fc.getSelectedFile().toString());
                                   //TODO: Write function to read in file and add all Hands to jList1
                                   //Recompile jList1
                                   jList1Objects = new Vector<String>();
                                   jList1Objects.add(fc.getSelectedFile().toString());
                                   jList1 = new JList(jList1Objects);
                                   jScrollPane1.setViewportView(jList1);
               pack();
               setSize(800, 800);
          } catch (Exception e) {
               e.printStackTrace();
}Here's the class my HTML file calls:
import java.applet.Applet;
import javax.swing.JFrame;
public class Main extends Applet{
     //Mainframe
     //JFrame f = new JFrame();
     public void init() {
          GUI inst = new GUI();
          inst.setLocationRelativeTo(null);
          inst.setVisible(true);
          //f.setContentPane(inst.getContentPane());
     public void start() {
        System.out.println("Starting...");
  public void stop() {
        System.out.println("Stopping...");
}

// <applet code='Main' width='400' height='200' ></applet>
import javax.swing.*;
public class Main extends JApplet{
    public void init() {
        GUI inst = new GUI();
        getContentPane().add(inst.getContentPane());
        validate();
    public void start() {
        System.out.println("Starting...");
    public void stop() {
        System.out.println("Stopping...");
}Other notes:
- You try to set the PLAF to Windows. which will not work on Linux and Mac (and if it did, the users would be screaming at you).
- setLayout(null)/setBounds(int,int,int,int) is rubbish GUI development, it is fragile and will cause problems (especially if changing PLAFs)
- Why did you not code this as a hybrid application/app?
- The call to the JFileChooser will require a trusted applet, and it is pointing to the wrong place in seeking out the 'Program Files' directory, better to put configuration data/history data in a sub-dir or user.home.
- This app. is much better suited to being deployed using Java Web Start. Forget the applet and use the frame, persistence can be obtained through the PersistenceService and that will side step both the application needing 'trust' and trying to find a suitable path for storing results of past games. JWS can launch the app. directly off the net, and provides auto-update and many other slick features.

Similar Messages

  • Need some basic help with Acrobat and LiveCycle

    This is my first time using Acrobat and LiveCycle to design a form. Basically all I need is a title that is uneditable and underneath that I want to insert a text box so people can type in the box then print off the whole page with their comments. I can do all of that except the problem is when I insert the text box, the cursor is left justified but appears in the middle of the textbox. So when people start typing, there is a huge gap between the title and what they've typed. I want their typing to appear directly under the title. What am I doing wrong? See attached for a visual explanation. Thanks.

    You can have the text in the field top jusitied. This is controlled on the Font palette. Turn on the Font palette under the window menu. It usually will appear in the bottom right corner of the screen. Now highlight the field you want to adjust. Make usre the paragraph tab is slected. Click on the small dropdown arrow indictaed in yellow in the screen shot and select "Edit Value". Now click the top justification as indicated by the arroe in the csreen shot.
    Paul

  • I need some basic help with Email setup

    Hello, I ve just been connected to infinity and I m trying to setup a few email addresses but the BT yahoo system is confusing me.
    I managed to create a new email (sub account) for my wife but I m struggling with finding a way to have a couple more for myself. Do I really need to make a sub account for each email?
    The default email has my name and surname in it which is not something I generally use for that purpose, I would only use that one for close friends and family, I would like to setup another one for general use and one for when there is a likelyhood it ll get a lot of spam.
    The way to add extra emails is usually very simple (with previous isps) , login to "manage my account" and choose username and password then enter the details in outlook express.
    With BT I m having to deal with the Yahoo thingy, which does a lot of more than just emails but at this time I have interest in it at all.
    1 - I would simply like to setup a few emails to use with outlook express, what is the best way to achieve that ?
    2 - The yahoo email seems to be part of a network like facebook, as I  don t intend to use that side of it I would prefer not to have my personal details associated with a profile that I do not  need . It seems to be for public viewing by default.
    Can I set up and use my emails without having an online profile for yahoo?
    How do i keep my details offline (not publicly viewable in yahoo)?
    thanks.

    yes!
    you get one prime email address. the one you agreed to and the one to set up your bt mail, it was in letter confirming bt set up. (order ref)
    for more for yourself, or anybody else,  its got to be sub. up to ten for INF2
    I have set up 4 sub accounts with different names, etc. but use the same password for all 5 .
    I then had them set up with outlook express, there is a bt prog to do this. look on site.
    Then I use incredimail as my final mail client, this also has a prog to set up from outlook express.
    so all my mail to and from me ends up in incredimail with my 4 sub accounts, using one as my prime.
    my bt prime I do not use, as it is my full name.
    so far so good, just a bit slow finding its way, like you my previous ISP (tesco) was less complicated, but slow copper wire.
    good luck
    Ronin22
    In the end we will all be star dust.
    Then start all over again.

  • Need some URGENT help with 3 DVD mastering issues PLEASE! :

    Hi there,
    Firstly, I am running DVD SP 3.0.2 on Mac OS 10.4.7 on a G5 Dual 2 GHz 3Gb Ram plenty of HD space...
    I am creating a DVD with: An intro sequence, a main menu, 4 sub menus, and 4 sections with around 12 chapters each.
    I am having some big problems, and a pretty stuck. I will lest them separately below, numbered. If you are able to help, please refer clearly to which number you are helping with. Any help is MUCH appreciated! Many thanks!!
    1. Each of the 5 menus (1 main, 4 sub) have a background video, and a separate audio track. I added the background videos by simply dragging them to the assests panel, then from there onto the menu editor window. They are created in FCP and are properly encoded. However, when I click the motion button, or use the simulator, the videos do not show up. The music plays, but all i see is plain black.
    What is going on?!?!?!
    2. I am really struggling with rollover buttons. I have custom created buttons, and I wand them to have a soft red glow around them when hovered over. HOW ON EARTH DO I ACTUALLY DO THIS??
    The buttons are in photoshop so can be exported with/without background/glow in any format.
    3. Is it possible, once I have got the above rollover working, to have an image to the right hand side of my buttons which changes with the the button rollover. i.e. hover over button 1, see image 1. hover over button 2, image changes to image 2.
    PLEASE PLEASE give any help you can, I have a deadline coming up and am quite stumped. Thanks again!!

    I am still having problems regarding issue Number 1. PLEASE ANYONE HELP?!
    Sorry, I'm not sure about the motion menus. I avoid those whenever possible. But you might click on the menu in the storyline tab (whatever it's called -- the hierarchical view with the disc, tracks, slideshows, etc.) and look at the properties and see if there's anything you have to enable specifically for motion. And be sure the motion button is on on the main display/preview area, but it sounds like you already know how that works.
    For your information, here is a screen grab of the menu I am trying to create:
    http://www.redhavoc.co.uk/stuff/menu.jpg
    I think it is obvious that when a button is hovered over, I want it to glow red, and the image to the right will change to match the respective button.
    IS THIS GOING TO BE POSSIBLE????
    Yes.
    First, your menus have to be layered menus. Unfortunately, there's no way to convert non-layered menus to layered menus, so if you already have non-layered, you'll have to just delete them and create new layered menus. The button (and menu item) to create a layered menu should be right by the normal new-menu item.
    Next, the graphical work is all in Photoshop.
    Side tip: You may already know this, but I found it's best to use 640x480 for the Photoshop document. When I do text and leave it as a text object in the Photoshop file, it resizes poorly in DVDSP. So this ends up being another 720x480 vs. 640x480 square/rectangular pixel conversion thing. DVDSP plays in the 640x480 world, at least as far as the designer can see. So I keep my images at 640x480, and it doesn't have to resize, and everything looks right.
    Moving on... Set up your basic background, the part that won't change (or will have other things covering it, like for your square image).
    Then put in all the buttons and images you'll be using, each part in a separate layer. This could have fifteen buttons (you have five buttons, and there can be three versions for each -- inactive, selected, and activated versions) and five or six square images (you said one for each button, and you might want a blank default if, say, you want to add a "back" button on the menu and want some blank or default image for the square when they're on the "back" button).
    Sometimes people don't bother with a separate "active" button state, but you usually want some visual feedback that they clicked the button. Also, I usually just build the default (unselected) button into the background; that's less hassle later on, and it will just draw the selected or activated buttons over that when the user is on that button.
    Line up all your buttons and images. All the square images lined up perfectly on top of each other, all the buttons in the right places (so you'll have three buttons stacked on top of each other in each spot). Give each layer a short but quickly recognizable name, and line them up in a consistent order. (button1-default, button1-selected, button1-active, button1-squarepicture, then button2-default, ... etc.) Photoshop and DVDSP don't care, but it makes it easier for you later.
    Note that earlier versions of DVDSP won't show Photoshop layer effects. (They handle layers, just not the effects, like inner glow, outer bezel, etc.) I don't remember when they changed this, but I think it was version 4.something. So if you're using that method to make your buttons glow, you may have to flatten each selected or active button layer, and you may even need to create a dummy blank layer underneath it first to give it something to flatten onto.
    Save the file as a standard Photoshop file (.psd). Drag the file onto your DVDSP layered menu and set it as the background.
    Now, in DVDSP, create all your buttons. Just drag boxes over/around the button pictures you have. Feel free to make them extra-big; users won't see the actual area you've selected, and bigger areas makes it easier for people to hit them if they're using a mouse on a computer to watch the DVD. You can point the buttons to their targets now if you want, and set the end jumps on the tracks if you want. (I tend to set the end jumps on the tracks so they automatically select the button for the next track.)
    Now's the fun part, since it will actually hook everything up and should be easy if your naming layer order were consistent. Click on the layered menu (in that hierarchical view) and look at the properties window. (Sorry I can't remember the technical names for all these windows; I'm doing this all from memory. So feel free to ask more questions if you can't find what I'm talking about.) One of the properties tabs should have a grid of checkboxes with a list of your layers. Make sure the background is checked for all of the states. Then check the layers you want to show for each button state, as well as the corresponding square image to show for each.
    Again, I'm doing this from memory, and I can't remember exactly how things are listed in that grid. But I remember it keeps your layers in the same order you put them in the Photoshop file and shows you those names, so it should make it easy to go down the list and check the right boxes.
    And another side tip: You can update the Photoshop file, but once you've put it in DVDSP, if you change the layer order, it will screw up the check boxes you checked. It always shows you the layer names correctly, but it keeps the checkboxes in DVDSP simply assigned to the layer number, so the fifth layer will keep the same checkboxes even if you juggle them so some other layer is now the fifth layer. So if you do juggle the layers in Photoshop, go back and fix the checkbox list in DVDSP.
    I put a sample Photoshop file based on yours in
    http://dan.black.org/layered-menu-sample.psd
    It's quick and dirty, but shows the layer layout, and you should be able to drop it on DVDSP to play with. (I also won't leave it there forever, maybe a few weeks, so anybody reading this in a month or more probably will get a 404 for that url.)
    Again, doing this from memory, so feel free to ask if anything doesn't work or doesn't make sense.
    G4/dual867   Mac OS X (10.4.5)   2GB/0.8TB

  • Need some quick help with redoing a website

    Hi, I did my website done in iWeb in 2008, published it, and have it hosted by GoDaddy. I want to take it offline for now and design a new 'under construction' site, but there is a chance that I might want to still go back to the original version.
    I see the current 'Domain' in Home Folder>Library>Application Support>iWeb.
    Can I just redo my site (still working in pre-2008 iWeb), publish it, and if I need to, use the old 'Domain' to revert to my current website?
    If yes, how do I do that....and, if 'no', what should I do?
    Thanks!

    Hi and thanks. To reply....
    I published the website in iWeb and it is on my MobleMe. It was done in iWeb v 1.1.2, and I have not upgraded iLife on the computer that I designed the website on, as I feared losing some/all of it in an upgrade.
    I do, however, pay GoDaddy for my corporate URL AND hosting....which I suspect is the forwarding and not 'hosting' per se....but on my Hosting account on GoDaddy it does say 'Shared Hosting'.
    I do not want to 'overwrite' my current site just yet, as I am uncertain about the next one's content or the time to do it the way I envision it. What I want to do is SAVE my current site in case I want it back and, in the meantime, put up a page that says Under Construction. Can you help with that?
    Much appreciated

  • I need some serious help with MPEG Streamclip and iMovie 11

    Hello, everyone!
    I hope that some kind soul here is able to help me. My sister-in-law asked me if I could help her re-edit a video that they made of a conference she gave because she didn't like the way some parts were edited. I oh-so-kindly (and perhaps stupidly) offered to help her out!
    A little background: even though I studied audiovisual communications in college, I leaned (a LOT) towards the audio production part of it and, lately, photography, too. That means that I'm not very good at the whole creating-a-movie-in-iMovie thing, even though I know it's supposed to be easy.
    So, here goes: I have a DVD from her which has the typical TS files for audio and video. I downloaded a program called MPEG Streamclip and then it said I needed to buy the QuickTime MPEG-2 Playback Component so that I could rip the DVD my sister-in-law gave me. I bought the component.
    I've converted, done small, 1-minute tests, of the DVD with MPEG Streamclip to DV and also to MP4 (just in case). I do it, then import them to iMovie 11. I don't edit anything at all, just a test to see how it looks, so I immediately send the project to iDVD to see how it looks. It DOES NOT look good.
    Compared to the DVD she gave me, which looks all smooth (picture-wise), mine has a certain amount (NOT HUGE) of pixelation. I can tell especially because there are some slides that were added to her project, so I can see the pixelated parts around the edges of the letters.
    The DVD she gave me does NOT look HD. In fact, it looks SD (4:3), so I don't believe it's that.
    If anybody here knows about this, what am I doing wrong? Am I not ripping it correctly using MPEG Streamclip? Am I not making the iMovie 11 project right? Am I burning in the "wrong way"?
    If it's the MPEG Streamclip ripping that I'm doing wrong, what are the settings I should be using? What format should I be using so that it is VERY iMovie-friendly?
    I want the final video that I would edit to look exactly as the one she gave me. That IS possible, right?
    For extra information, if needed, I am running a MacBook Pro, 13", i7 with 4 GB of RAM and am running OS 10.6.6. I've been a Mac user since the OS 9 days.
    Thanks in advance for anyone who helps me out.
    Serge

    Ok. Got it!!!
    Z, thanks a lot!! Now things don't look pixelated and my test burn looks exactly like the dvd my sister-in-law gave me... except for ONE THING:
    There are these graphics done in I-don't-know-what program with a cube transition. They look like when you do 3D cube transitions in virtual desktop, you know?
    Anyway, HER dvd looks completely smooth when you see these transitions but MY dvd looks... well, not right. It looks a bit like the screen or the letters "tremble" or shake a bit. I hope you can understand what I'm saying.
    I followed your advice to the letter and everything is perfect with the exception of those transitions (because after the transition passes and you see the slide with the writing, it looks completely smooth).
    Do you know of something that I can do to help with this problem?
    Thanks again!
    Serge

  • I need some serious help with Oracle Database....PLEASE!!

    I am using Microsoft Virtual PC 2007 that has Oracle Database 10g and Wondows XP installed on it.
    Database instance is DOWN but that is not the problem
    Listener is UP
    Agent Connection to Instance is DOWN, and I cannot get this running!
    How can I fix this problem? I am not an expert, but I have been trying for a long time to fix this issue, but I can't. It just came to the point that I want to grab my pc and throw it across the room.
    Error message: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)
    Here is my LISTENER.ORA file:
    # listener.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
    # Generated by Oracle configuration tools.
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    Here is my TSNNAME.ORA file:
    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.109)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = orcl)
    EXTPROC_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (CONNECT_DATA =
    (SID = PLSExtProc)
    (PRESENTATION = RO)
    Once again, I am not an expert, so please try to explain it as simple as possible...I know, I am an idiot when it comes to networking issues.
    if you guys need some more information, just let me know!
    Thank you!

    What I mean is that I can get the Instance UP with no problem, but the Connection with the Instance is the problem.
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl service
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:38
    :06
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "D000" established:0 refused:0 current:0 max:1002 state:ready
    DISPATCHER <machine: PAOLOSCAMARDELL, pid: 2576>
    (ADDRESS=(PROTOCOL=tcp)(HOST=paoloscamardell)(PORT=2307))
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:144 refused:0 state:ready
    LOCAL SERVER
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>lsnrctl status
    LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 25-NOV-2009 21:52
    :03
    Copyright (c) 1991, 2005, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Produ
    ction
    Start Date 25-NOV-2009 11:50:27
    Uptime 0 days 10 hr. 1 min. 39 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\oracle\product\10.2.0\db_1\network\admin\listener.o
    ra
    Listener Log File C:\oracle\product\10.2.0\db_1\network\log\listener.log
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.109)(PORT=1521)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "orcl" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orclXDB" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    Service "orcl_XPT" has 1 instance(s).
    Instance "orcl", status READY, has 1 handler(s) for this service...
    The command completed successfully
    C:\Documents and Settings\Paolo\Desktop\courselabs\labs>

  • Need some urgent help with my (simple) Applet!

    Hello, I'm pretty new to Java and I am beginning to like it!
    I'm still verry much new to the language, but if you can help me you make me verry happy!
    Oke so I made an Applet where if you push on the button Omhoog, Omlaag, Links, Rechts, and Reset the ball (created with g.Oval in the methode paint) the ball should move above, down, left, right, and with reset it should go to the specified beginningpoint. The thing which I can't get to work is that when you push for instance on rechts(right) I want it to change in color for each specific movement (i.e left right...) and turn to black again when pushing on the reset button. I have been meshing around with if and else but I don't seem to know how to set this proparly. (I hope you can help me out!)
    this is my sourcecode:
    package oefening80;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Applet1 extends Applet {
    int xPos = 130, yPos = 130;
    Button Omhoog, Omlaag, Links, Rechts, Reset;
    boolean geklikt, gekliktL;
    public void init() {
    setBackground( Color.yellow );
    setLayout( null );
    geklikt = false;
    Omhoog = new Button( "Omhoog" );
    Omhoog.addActionListener( new OmhoogHandler() );
    Omhoog.setBounds( 120, 20, 50, 20 );
    gekliktL = false;
    Omlaag = new Button( "Omlaag" );
    Omlaag.addActionListener( new OmlaagHandler() );
    Omlaag.setBounds( 120, 60, 50, 20 );
    Reset = new Button( "Reset" );
    Reset.addActionListener( new ResetHandler() );
    Reset.setBounds( 120, 40, 50, 20);
    Links = new Button( "Links" );
    Links.addActionListener( new LinksHandler() );
    Links.setBounds(70, 40, 50, 20 );
    Rechts = new Button( "Rechts" );
    Rechts.addActionListener( new RechtsHandler() );
    Rechts.setBounds( 170, 40, 50, 20 );
    add( Omhoog );
    add( Omlaag );
    add( Reset );
    add( Links );
    add( Rechts );
    public void paint( Graphics g ) {
    g.fillOval( xPos, yPos, 30, 30 );
    class OmhoogHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    yPos -= 10;
    repaint();
    class OmlaagHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    gekliktL = true;
    yPos += 10;
    repaint();
    class ResetHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos = 130;
    yPos = 130;
    repaint();
    class LinksHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos -= 10;
    repaint();
    class RechtsHandler implements ActionListener {
    public void actionPerformed( ActionEvent e ) {
    xPos += 10;
    repaint();
    thanks.

    Gotten tag.
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Applet1 extends Applet
         int     xPos = 130, yPos = 130;
         Button  Omhoog, Omlaag, Links, Rechts, Reset;
         boolean geklikt, gekliktL;
    public void init()
         setBackground( Color.yellow );
         setLayout( null );
         ActionListener actl = new OHandler();
         geklikt = false;
         Omhoog = new Button("Omhoog");
         Omhoog.addActionListener(actl);
         Omhoog.setBounds(115, 20, 60, 20 );
         gekliktL = false;
         Omlaag = new Button("Omlaag");
         Omlaag.addActionListener(actl);
         Omlaag.setBounds(115, 60, 60, 20 );
         Reset = new Button("Reset");
         Reset.addActionListener(actl);
         Reset.setBounds(120, 40, 50, 20);
         Links = new Button("Links");
         Links.addActionListener(actl);
         Links.setBounds(70, 40, 50, 20 );
         Rechts = new Button("Rechts");
         Rechts.addActionListener(actl);     
         Rechts.setBounds(170, 40, 50, 20 );
         add(Omhoog);
         add(Omlaag);
         add(Reset);
         add(Links);
         add(Rechts);
    public void paint(Graphics g)
         super.paint(g);
         g.fillOval(xPos, yPos, 30, 30 );
    class OHandler implements ActionListener
    public void actionPerformed(ActionEvent e)
         Object obj = e.getSource();
         if (obj.equals(Omhoog)) yPos -= 10;
         if (obj.equals(Omlaag)) yPos += 10;
         if (obj.equals(Rechts)) xPos += 10;
         if (obj.equals(Links))  xPos -= 10;
         if (obj.equals(Reset)) 
              xPos = 130;
              yPos = 130;
         repaint();
    [/code
    Noah                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Started with a networks project,needed some basic help.. (Newbie)

    Hi all,
    Im planning on writing an app that will communicate with my server and a telecom gateway... Which will send and recieve data...
    Im a beginner to java itself and have taken this up as a project.
    I would like to know what needs to be learnt(Im familiar with OO concept and have done a bit on java for now, but not this extent.)
    Primarily I will be dealing with mulit-threading and so on.
    Could you please point me out to some details...
    If this info is not sufficient ,I'll provide more.
    Regards

    You will find that google is very useful if you are getting started.
    [http://www.google.co.uk/search?q=java+tutorial+networking]
    [http://www.google.co.uk/search?q=java+examples+networking]
    [http://www.google.co.uk/search?q=java+tutorial+threading]
    [http://www.google.co.uk/search?q=java+examples+threading]
    If you have question, try searching for it as the question will have been asked before.

  • Complete Novice Needs Some Basic Help

    Hi!
    I'm sorry to clutter up the discussion with such basic questions, but what I want to do is get something from a cassette tape to my iPod. I'm told I can do this through GarageBand, and I have an audio cable that the guy in the Apple store said I would need. I'm not even sure where to plug this cable in. So any help in where I plug this in, or what I do next would be tremendously appreciated. If someone could even tell me where to look for help that would be great (when I look in GarageBand help its saying something about MIDIs and I don't even know what that is). Eternal gratitude for any help....

    Oh man, this is frustrating and I might give up soon!
    So in System Preferences, Sound I have 2 things,
    Internal Microphone (port is Built-in) and Line In
    (port is Audio line-in port). I can't seem to
    select one or the other, they're just there.
    Yeah, there is no "apply" or "OK" or anything like that. Just click on the Line-In so that it is highlighted and close the system preferences. That takes care of that. My PB G4 automatically detects when I plug in my line-in now that it is set up.
    Then in GB preferences, I only have the option of
    Built-in Audio, there is no other option.
    Built-In audio is correct in GB prefs.
    I also couldn't find where you were saying to
    double-click...what's the track header? I've clicked
    everything and can't find a monitor drop down menu
    option.
    The track header is the left-hand side of the track where there is a small speaker or instrument. For what you are doing, you need to create a new basic track. (Under "Track" in the menu bar, click "New Basic Track") You should have a new blue track that is labeled "No Effects." Double click on the speaker image and a dialog box will appear. Right in the middle of this box there are options for Input, Volume, and Monitor. You can turn on and off monitor abilities here.
    On the plus side, the connector I have seems to
    work...its male/male 1/8".
    Perfect.
    Thanks again and if you want to bail out, I
    completely understand!
    Hang in there. We were once all newbies to this digital recording stuff too.

  • I'm new to java and I need some quick help with NetBeans.

    Hi. To whomever can help here's the problem. I've been trying to install netbeans ide 5.0 on my computer for a while now and i can't seem to find out what is wrong. I'm in a java programming course and i need the J2SE Developement Kit 5.0 Update 7 and NetBeans IDE 5.0 Installer on my comp. Whenever i go to install it, it can't automatically create a directory and has erroe null in place of it. Whenever i made a new directory for it a page would come up telling me all of the errors during the installation which are null. Since i have administrator privelages and plenty of free space on my hardrive.

    Hi,
    I want to suggest you that
    1.please check if any prerequisite is require before installing the NetBeans IDE,i hope there is nothing like that except proper jdk on your machine.
    2.if you already having JDK on your machine check for the compatibility of that jdk version with the required NetBeans IDE version.
    3.follow the steps provided to install the NetBeans IDE 5.0 for that refer the below link
    http://www.netbeans.org/community/releases/50/install.html
    hope you will get rid of the problem .....
    ---Vidya

  • I'm a newbie and need some basic help...

    I'm a newb trying to teach myself Director. I'm trying to
    make a menu and I'm having some problems....
    I have 3 main buttons. When you click one of the main
    buttons, 3 sub buttons pop up next to the button pressed. When one
    of those sub buttons is pressed, a box pops up to the right of the
    sub buttons and has a list inside containing links to movies. When
    one of the links is pressed i want the movie to take the place of
    the links in the box. When the movie is done playing it will
    disappear and show the links again.
    I uploaded what I have done here...
    http://www.lohrmandesign.com/uploads/Template.dir
    If you look at it, could you tell me what I've done
    correctly, and how I should go about implementing the rest of the
    menu? I imagine you have to use director movies within the main
    director movie, but I haven't figured out how to implement that. Or
    possibly use the .visible command? Thanks for any help...Online
    resources and examples are scarce for Director it seems.
    And I'm not sure if i have to upload all the pics for you to
    view my movie correctly, If I do, just let me know...

    quote:
    Originally posted by:
    Newsgroup User
    I haven't looked at your Director file, but what you want to
    do sounds
    pretty simple. First of all, though, can you clarify what you
    mean by
    "movie," because Director's terminology makes it kind of
    confusing. Are
    you speaking of a Director movie, or digital video?
    If you want to jump to a different Director movie, simply do
    something
    like this:
    on mouseUp me
    go to frame "StartMovie" of movie "Option1"
    end
    To get back to your menu, just use an exitFrame command at
    the end of
    the Director movie that takes you back there.
    If you're referring to starting a digital video, just put
    your video
    somewhere in the same Director file your menu is in, label it
    with a
    marker, and simply jump to that marker. Like this:
    on mouseUp me
    go to frame "Video1"
    end
    To get back to your menu at the end of the video do something
    like this:
    on exitFrame me
    if sprite(5).movieRate = 1 then
    go to the frame
    else
    go to frame "Menu"
    end if
    end
    Hope that helps.
    Sorry, I should have clarified...When you click on a sub
    category button, a Quicktime video will play, not a Director
    "movie"...Thanks for the help! using the method you described, that
    would make the menu disappear when the video is played, and reload
    the menu when the movie is done, right? I want the menu to stay
    visible while the movie is playing...

  • Need very basic help with calendar - I am such a beginner!!!

    OK, I apologize in advance if this is a very silly question. But I'm new to all this stuff and really have no clue as to what I'm doing.
    I just got a brand new iPhone. It's great! I am using the calendar feature that came with the phone. But I can't figure out how to make it "talk" to my husband's calendar. He uses Microsoft Outlook. I've skimmed through lots of articles about Microsoft Exchange... but I don't have any Microsoft programs. I am a stay at home mother, and have been out of the technology loop for a while. It looks like I need a Microsoft Exchange account? I can't figure out how to get Microsoft Exchange, and if it's going to cost a fortune.
    I'm not even sure where to find which software is on my phone! There is no "about this phone" button that I can find. It's brand new, I think it was 3S and is 16GB if that helps.
    Can someone please save me from myself?
    Thanks!

    You could have the TC join your existing wireless network as a client, or you can can connect the Time Capsule's WAN port to the modem/router.
    In both cases the TC's "connection sharing" should be set to "Off (Bridge Mode)".
    If the TC "joins" the wireless network you can only back up over your wireless connection, so the second option is preferable.

  • I need some syntax help with reading some values from a selected row in an Access form.

    My goal:  to extract the data from 4 fields in a datasheet row and place them in another form.
    My problem:  I can only get the field values from the first row of the datasheet.
    I have tried using the Form_Click event as the location for the code I've tried.  This seems to be the right place, but apparently referring to the desired fields by their names with Me. in front just references the first record in the datasheet, not
    the one I've selected.
    Should I just read the source form's recordset using the Currentrecord value somehow?  I could use some direction on that.
    Thank you.
    Marj Weir

    It's generally considered good forum etiquette to post back a description of the solution which you've reached.
    The normal control for a multi-valued field is a combo box rather than a text box, but unless it is necessary for you to use a  multi-valued field, i.e. your database is interfacing with SharePoint in the very limited context in which this feature is necessary,
    I'd advise that you model the many-to-many relationship type in the time-honoured way by means of a table which resolves the relationship type into two one-to-many relationship types, and use a subform to show the data.  You can alternatively use a multi-select
    list box or a text box which shows a value list.  You'll find examples of all three methods in StudentCourses.zip in my public databases folder at:
    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169
    If you have difficulty opening the link copy its text (NB, not the link location) and paste it into your browser's address bar.
    Ken Sheridan, Stafford, England

  • Need some basic help -- my iTunes no longer plays all songs in my playlist

    I've created a holiday playlist, and for some reason iTunes will only play one song and then the music stops. I must manually press play to get the next song to play. The music also stops when I try to fast forward to the next song or back up and play the previous song. In either case, I can get the music going again by pressing play, but again iTunes will only play that one song.
    I've got checks next to every song in the list. I've been toggling repeat and shuffle on and off with no luck.
    FYI...I'm having no trouble with my other playlists. This is especially frustrating since my parents aren't interested in listening to my other music -- only the holiday tunes.
    Would appreciate anyone's suggestions for how to resolve.

    Solved it. Hold down option (alt) while launching iTunes, and it asks to locate the iTunes library. Point it at the file called "iTunes library". All is back where it belongs. Apparently pointing to it in the Advanced tab wasn't enough.

Maybe you are looking for

  • Stereo Line-in for an iPad

    Has anyone been able to find a lightning cable, breakout box, or dock that allows for stereo recording into an iPad/iPhone?  There are several stereo mics on the market that plug directly into the lightning port so I know it is possible to send the s

  • SCOM 2012 - Additional Management Server - Database not Found (no errors)

    Hello, I am installing a second management server (SCOM 2012) and am running into an issue connecting to the existing database.  I selected Add a Management server to an existing management group. On the installer page Configuration/Configure the Ope

  • Oracle Application R12.1.1 Migration from Solaris to Linux 64-bit

    Hi, Our existing System: On Solaris 9: Database 10.2.0.2 EBS 11.5.10.2 We are planning to Upgrade the system to Database 11.2.0.3 EBS R12.1.3 We also want to migrate to RHEL 5 64-bit. Please let me know if you have experience with respect to the foll

  • Please tell me why?

    why float a=Integer.getInteger(price_tx).floatValue();always show exception when exec

  • Pottery Barn 7-10 day message.,.

    applied for the PB card (the last one I want before gardening indefinitely) and got the stupid 7-10 message. Should I wait for the letter or call now? How are they with recons? Thanks y'all!!!!