Disappearing buttons in applet

When I view an applet I have created on a webpage it works fine. Then I scroll down a bit and the buttons drop out of view. Then I scroll back and the buttons seem to disappear. Placing the mouse over them brings them back. Check it out for yourself http://www.publict.co.uk/applets/quiz/tester.html
Any ideas?

Something is definitely wrong. What do you do? Are you looping or something? The CPU idle time goes down to 0% and the cursor flashes. The buttons where only displayed when the applet was shown, and then they disappeared. Perhaps you are calling repaint in a loop, or the paint loops itself.

Similar Messages

  • Need help with buttons in applet

    stupid question maybe but i'm a beginner, and hey..there are no stupid questions, right? well, i may prove that wrong...anyway...
    I can't relocate a button, or any other component for that matter. When I try to make a simple applet with just one button showing, then it works perfect...but when I make the applet a little bigger with some graphcis and text, the setLocation() and setSize() methods don't work. the wierd part is that I don't get an error message, the compiler just ignores those lines...so it seems anyway.
    If anyone can help me I'd be very greatful
    thanx a lot

    Do you know there are 5 layout managers in java. It is probably worth looking through each one and the commands they use.
    The layout is determined by two things:
    1.position Components are added
    2.Layout manager used
    Ive never had to use setLocation() and setSize() as the layouts do it for you:
    1.Flowlayout: which is the default pane. e.g.
    setLayout(new Flowlayout()).
    2.GridLayout: postions panels into rows and columns
    b.GridBagLayout
    3.Borderlayout(NORTH,SOUTH,EAST,WEST and CENTER) postions in applet.
    4.CardLayout(a bit like a slideshow)
    5.Insets() which is used to determine top,bottom,left and right.
    Don't bother about 4 or 5 yet. But definitly have a look at the other 3.
    e.g. setLayout(new BorderLayout());
    add("North", new Button("ok"));
    add("CENTER", new Button("Exit");
    etc..

  • Disappearing buttons in InDesign CS5

    I am doing an interactive newsletter in ID CS5 that is laid out similar to a web site. It has rollover menus at the top containing subtopics that can be linked to (on other pages) when the user clicks on them (using the Go To Destination action). Each menu consists of a transparent rectangle, A text box for the menu title, and 2 or 3 text boxes for the subtopics. All elements are buttons. When the user rolls over the menu title text box, the rectangle and subtopics are supposed to appear. When the user rolls off the rectangle (which is behind everything else), the rectangle and subtopics will disappear.
    When I created an interactive pdf and viewed it in Acrobat 9, The roll over actions work correctly. But as soon as you touch one of the subtopic text boxes, even though you are technically still on top of the rectangle, the menu disappears. Therefore, the user cannot access the subtopics which jump to other pages. Occasionally, I can get the pdf to perform correctly, but this behavior is very sporadic. I am also finding that once opened, the menus tend to "stick" and stay up sometimes even after you roll off.
    Now that I have added animations to my document and placed an exported .swf in its own layer on every page, on my newly exported pdf, the menus disappear every time so the buttons for the subtopics do not work, even sporadically.
    Hope you can help! thank you!

    Never mind. I figured it out. I can't believe how poorly designed this entire Adobe site function.
    Amazing...the screen says "Welcome sssttteeevvveee" in the top left corner, which, of course makes you think you're logged in, right?
    But no. You need to click on the login/register link under the black Forums box...like, why?
    Note to Adobe. TIme for a little rethink here.
    S.

  • How to create a browse button in applet

    Hi All,
    Need another help...
    I want create a Browse Button in java applet frame such that if I click on that button, I can pick a file from any folder of my machine.
    Is there any way to do so? If yes, can you give me a small code as example.
    Regards,
    Uji

    Hey Ujjal,
    I know it's late and I don't know if you're still having this issue but maybe this can be helpful to the next person who has it. As was already said, I think you should probably consider doing this project as an application rather than an applet to avoid file access permission problems. That said, here's how I would do it (since no one has answered your question directly):
    First this class should extend JFrame or some other window class
    Next create a file object (it's static so it can be accessed by anonymous classes later):
    private static File myFile = null;Then, inside the appropriate method (probably something like init() or main()), make the button and give it some functionality with an anonymous MouseListener:
    JButton myBrowseButton = new JButton("Browse");
    myBrowseButton.addMouseListener(new MouseAdapter(){
        // an anonymous MouseAdapter
        public void mouseClicked(MouseEvent e){
            ...now in here you'll want the code to make a JFileChooser in a dialog window
            // create a dialog window
            final JDialog myChooserDialog = new JDialog();
            myChooserDialog.setTitle("Browse");
            // an anonymous JFileChooser
            JFileChooser myFileChooser = new JFileChooser(PATH){
                // an anonymous instantiator to set the text of the select button
                { setApproveButtonText("Select"); }
                // what to do when the user clicks select
                public void approveSelection(){
                    // you might want to make sure the selected file is valid before this step
                    myFile = getSelectedFile();
                    myChooserDialog.dispose();
                // what to do if the user clicks cancel
                public void cancelSelection(){ myChooserDialog.dispose(); }
            ...add the chooser to the dialog and make it visible
            myChooserDialog.add(myFileChooser);
            myChooserDialog.setVisible(true);
            myChooserDialog.pack();
    });Now add the button to the frame and make it visible
    add(myBrowseButton);
    setVisible(true);
    pack();A few notes:
    1) Replace the word PATH with the path to the directory you want to browse (e.g. "." the current working directory)
    2) Make sure all of that code except for private static File myFile = null; goes into a method and isn't just floating around
    3) If ANY of this was confusing then go D.A.F.T (Do A Fecking Tutorial!)
    good luck!
    pieman

  • How do i have status bar and a back button  for applets?

    I have an applet which displays a set of panels in order. Is there any way that i can have a status bar like in an browser and a back button so that it can go back and go forward. What do i need to do? Is there any sample code to do so. I am new to java and learning.
    Thanks
    Ram

    Status-Bar -- a long thin panel with a long TextField. Perhaps use something from the BorderFactory class to seperate it from other parts of the screen...
    Back Button -- Keep track of your panels in a CardLayout, for example, then use a Button with an action listener that uses the CardLayout's previous() method to move back to the last panel.

  • How can we close the window using a button in applet?

    I have a close button in my applet which should close the browser from where the application is launched. Can somebody post a sample code for doing the same?

    I'm afraid I don't have any sample code, but I can describe a possible solution.
    1. Retrieve the JSObject via Application.[url http://docs.oracle.com/javafx/2/api/javafx/application/Application.html#getHostServices%28%29]getHostServices().[url http://docs.oracle.com/javafx/2/api/javafx/application/HostServices.html#getWebContext%28%29]getWebContext()
    2. Use the JSObject to manipulate the JavaScript into closing the Window.

  • Close button in applet

    hi u see in the code that i have made a button an exit button and i did this code but when i run the code is fine but when i click the exit button it dos not clos the applet
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    public class assignment2_1 extends Applet implements ActionListener {
         JTextField ID, Mark;
              JLabel IdLabel, MarkLabel;
         JButton ExitButton;
    JTextArea Disply;
    String stnum;
    int studentnum;
    int stid;
    int assimak;
    public void init() {
    GridBagLayout GBL = new GridBagLayout();
         GridBagConstraints cr= new GridBagConstraints();
         setLayout(GBL);
         setBackground(Color.lightGray);
         cr.weightx=cr.weighty = 2.0;
         cr.gridx=1; cr.gridy =2;
         cr.gridheight = 1; cr.gridwidth = 2;
    add(IdLabel=new JLabel("Enter Student ID"),cr);
    //     IdLabel.setBackground(Color.lightGray);
         cr.weightx=cr.weighty = 2.0;
         cr.gridx=5; cr.gridy =2;
         cr.gridheight = 1; cr.gridwidth = 2;
         add(ID = new JTextField(9),cr);
    cr.weightx=cr.weighty = 2.0;
         cr.gridx=1; cr.gridy =3;
         cr.gridheight = 1; cr.gridwidth = 2;
         add(MarkLabel=new JLabel("Enter Assignment Mark"),cr);
    //     MarkLabel.setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=5; cr.gridy =3;
         cr.gridheight = 1; cr.gridwidth = 2;
         add(Mark=new JTextField(9),cr);
         Mark.addActionListener( this );
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=1; cr.gridy =4;
         cr.gridheight = 1; cr.gridwidth = 2;
         add(Disply=new JTextArea(10, 20),cr);
         Disply.setEditable(false);
    //     Disply.setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 1.0;
    cr.gridx=5; cr.gridy =5;
         cr.gridheight = 1; cr.gridwidth = 2;
         add(ExitButton=new JButton("Exit"),cr);
         ExitButton.addActionListener( this );
    /*     Container container = getContentPane();
              container.setLayout( new FlowLayout() );
         IdLabel = new JLabel("Enter Student ID ");
              container.add( IdLabel );
         ID = new JTextField(9);
              container.add( ID );
         MarkLabel = new JLabel("Enter Assignment Mark ");
              container.add( MarkLabel );
                   Mark = new JTextField(5);
                   Mark.addActionListener( this );
              container.add( Mark );
              Disply = new JTextArea( 10, 20);
              Disply.setEditable(false);
                   container.add( Disply );
         ExitButton = new JButton("Exit");
         ExitButton.addActionListener( this );
              container.add( ExitButton );
    stnum = JOptionPane.showInputDialog( "Enter total assignment" );
    public void actionPerformed(ActionEvent evt) {
    studentnum = Integer.parseInt( stnum );
         stid = Integer.parseInt(ID.getText());
              assimak = Integer.parseInt(Mark.getText());
    if (evt.getSource() == Mark)
    showStatus ("heeeea "+ studentnum);
         if (evt.getSource() == ExitButton )
              System.exit(0);

    Are you trying to run this in a browser or using AppletRunner? I don't think you can close a browser window just by calling System.exit(). You have to find some way to close the browser.
    Check for exceptions in the Java console.

  • Link button in applet to open html file in same window

    Hello I am an student in holland.
    I am working on a project but can't find a code to make a button what links to an html file practicly just a link
    I got a html where i need to implent the applet to the applet only needs 10 buttons who can link to another html file or site.
    its not realy difficult i geus but i just cant find the right codes and because i only got 1 day left im asking for help on this forum.
    I realy hope you guys can help me.
    greets,
    Rob

    It's hard to tell what you're asking, but you should probably take a look at java.applet.AppletContext.showDocument.

  • Disappearing Buttons

    Hi, I've run into a problem concerning buttons added to a form. Ive added buttons to the user defined fields area of item master data (formType = -150). This works fine, but when I close the user defined fields part and the reopen it the buttons disappear. Then whenever I open Item master data there are no buttons. I have to restart the add-on. Any suggestions?

    It doesn't seem to be working for me... this is how I translated it to C#:
         if (pVal.FormTypeEx.Equals("-150"))
              if (pVal.EventType.Equals(SAPbouiCOM.BoEventTypes.et_FORM_LOAD) && pVal.BeforeAction == false)
              oForm = SBO_Application.Forms.GetFormByTypeAndCount(-150, pVal.FormTypeCount);
              ItemMasterData();
    I replaced EventEnum with pVal.EventType I don't know if that might be the problem...
    ItemMasterData(); is a function that creates the buttons.
    Message was edited by:
            Costas Ioannou
    Message was edited by:
            Costas Ioannou

  • Opening browser with button on applet

    I'm writting an applet and I want to open another page written in html with a simple click on a button on my applet. I found a class BrowserLauncher and this works in an application but not in an applet.
    Can someone help me with my wish to be able to open a new html page from my applet?
    Greetz

    That was the big problem. I couldn't use showDocument because I used different JPanel to show my applet. I couldn't take my applet as a parameter of my constructor of my JPanel. Now I decided to use AppletContext as parameter of my JPanel. But is stil doesn't work I get a MalformedURLException. Nothing to do with my applet of course.

  • Hide a button on applet

    I have a requirement where the business wants me to hide an extra button on the attachment applet.
    Any advise.
    Thanks,
    Nitika

    Bobb
    Can you please share that document with me.
    kindly mail the same
    Thanks
    Prakash
    Edited by: user3995371 on Nov 14, 2010 7:22 AM

  • Exit button in applet

    hi u see in the code that i have made a button an exit button and i did this code but when i run the code is fine but when i click the exit button it dos not clos the applet
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    public class assignment2_1 extends Applet implements ActionListener {
    JTextField ID, Mark;
    JLabel IdLabel, MarkLabel;
    JButton ExitButton;
    JTextArea Disply;
    String stnum;
    int studentnum;
    int stid;
    int assimak;
    public void init() {
    GridBagLayout GBL = new GridBagLayout();
    GridBagConstraints cr= new GridBagConstraints();
    setLayout(GBL);
    setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=1; cr.gridy =2;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(IdLabel=new JLabel("Enter Student ID"),cr);
    // IdLabel.setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=5; cr.gridy =2;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(ID = new JTextField(9),cr);
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=1; cr.gridy =3;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(MarkLabel=new JLabel("Enter Assignment Mark"),cr);
    // MarkLabel.setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=5; cr.gridy =3;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(Mark=new JTextField(9),cr);
    Mark.addActionListener( this );
    cr.weightx=cr.weighty = 2.0;
    cr.gridx=1; cr.gridy =4;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(Disply=new JTextArea(10, 20),cr);
    Disply.setEditable(false);
    // Disply.setBackground(Color.lightGray);
    cr.weightx=cr.weighty = 1.0;
    cr.gridx=5; cr.gridy =5;
    cr.gridheight = 1; cr.gridwidth = 2;
    add(ExitButton=new JButton("Exit"),cr);
    ExitButton.addActionListener( this );
    /* Container container = getContentPane();
    container.setLayout( new FlowLayout() );
    IdLabel = new JLabel("Enter Student ID ");
    container.add( IdLabel );
    ID = new JTextField(9);
    container.add( ID );
    MarkLabel = new JLabel("Enter Assignment Mark ");
    container.add( MarkLabel );
    Mark = new JTextField(5);
    Mark.addActionListener( this );
    container.add( Mark );
    Disply = new JTextArea( 10, 20);
    Disply.setEditable(false);
    container.add( Disply );
    ExitButton = new JButton("Exit");
    ExitButton.addActionListener( this );
    container.add( ExitButton );
    stnum = JOptionPane.showInputDialog( "Enter total assignment" );
    public void actionPerformed(ActionEvent evt) {
    studentnum = Integer.parseInt( stnum );
    stid = Integer.parseInt(ID.getText());
    assimak = Integer.parseInt(Mark.getText());
    if (evt.getSource() == Mark)
    showStatus ("heeeea "+ studentnum);
    if (evt.getSource() == ExitButton )
    System.exit(0);

    U wrote:
    if (evt.getSource() == ExitButton )
    System.exit(0);
    Try the following:
    assign a ActionCommandString to your Button using the setActionCommand-Method and then, in the ActionListerner:
    if (evt.getActionCommand().equals("Exit"))
    stop();

  • Strange behavior (disappearing buttons, tabs, and more)

    Very recently (within the past 3 days and long after installing 10.4.9) Safari on my iMac G5 has been exhibiting very strange behavior.
    Some of the symptoms:
    - crashes frequently for no apparent reason
    - toolbar loses buttons and/or buttons are there but don't react to mouse clicks; sometimes a standard button, like forward, will simply disappear while backward remains
    - text in URL field will become 'bolded' and sometimes difficult to read/blurry
    - tabs often lose their dividing line boundaries
    - auto entries usually not present
    I have erased the preference list for Safari in my user library and repaired my permissions without any success.
    Any suggestions?
    Thank you very much for any help.

    Hi
    Please post a crash report - when Safari crashes, the "quit" panel has a "report" button. Select it, then copy/paste the entire contents to your reply.
    While you are at it, try the site from another User Account. If you need to create a new account, please follow these steps:
    Here is guidance from Apple on how to set up the account. You can ignore step 7 in the article.
    Also, on the system preference>Accounts panel, click on "log-in" options. There, select "fast user switching". This allows you to go back and forth between user accounts via an icon in your Menu Bar at the top of the computer screen.
    Log-on to the new account and start Safari. If Safari is stable in the new account, then your problem is specific to your regular user account. Otherwise, similar response means a system-wide problem.
    Post back with results.

  • History button disappears.

    I recently gave in and upgraded to the latest Firefox (3.6.3 specifically) after ages stubbornly sticking to Firefox 3.0. All in all upgrade has gone well. However, lately I find that the history button next to the url bar randomly disappears. It's easily restored by clicking "customize" on the navigation bar, but the fact this happens every few days has me somewhat flummoxed. Anyone have any ideas why this would be happening?

    Updating to a newer version may easily mess the toolbar configuration. You are suggested launching Firefox [[Safe Mode]], and select “reset all the buttons from toolbar” then click restart Firefox. (I don't know what is exactly called in English version). And then, you will see all the buttons are restored to default settings. You may now re-drag-and-drop all buttons including your disappeared buttons in customize.

  • Move to the parent applet on clicking the back button

    Hey,Every Body!
    I am trying to make a project in which i have a problem , my project has mutiple applets and i want that on clicking on the back button current applet should be closed and instantly the parent applet should be opened.
    Please help me to solve this problem.
    Thanks

    Hey, you can take any two applets , i only want to move the parent applet on clicking on the back button .
    For Example suppose on the first applet i have inserted my username and emailid then on clicking on the next button , second applet is opened in which i have to submit my personal details like my name, my address, my phone number ,but instantly i thought to change my email id or my username in that case i want that there should be a button on the second applet on clicking of which second applet should be closed and the parent applet should get focused again.

Maybe you are looking for

  • Installing Adobe Photoshop - disk full when it isn't?

    Here it is, I am running windows 7 ultimate from a 40gb ssd card (which is almost full) however I save all of my programs, files, pictures etc. onto my secondary 3TB drive which is almost empty. Trying to install adobe photoshop elements 12 - says th

  • Defining Distribution Functions

    Dear, In SOP base planning i define "Dstribution Functions". Can any one help what its and how functionally it works? I define this thing under path : Production - Basic Data - Bill of Material - Item Data- Item Data from Related Application Areas -

  • Using DSP Module to control C6713 DSK

    Hi, I am doing an Automatic Noise Cancellation design, and am using the LabView DSP Module and downloading code to a TI C6713 DSK.  I need 1 microphone to measure ambient noise, and a 2nd microphone to measure my desired speech signal. I would like t

  • ITunes trying to restore all the time

    Apologies if this has already been discussed. I setup my iPhone 5 before going traveling on my laptop (windows vista). After returning home and wanting store my pictures and change my music etc upon connecting my phone to the exact same laptop with a

  • What happened to the Triangulator class?

    I understand there were some bugs in the Triangulator class. It failed for polygons with holes in them, according to the docs...It seems that the entire class was deprecated. Does anyone know what the replacement is? Or if there is one? I am working