java swing question (beginner)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: java swing question (beginner)

  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Question java swing question (beginner)

    Hi,

    Quick question about swing jwindows - does anybody know how to remove the status bar that sits at the bottom of a JWindow or any code that i can use to manipulate the status bar (i.e. change text on the status bar from java applet window to page loaded) - please see attached bmp if you need some clarification.

    thanks
    fergal.
    Attached Images Attached Images

  2. #2
    Join Date
    Mar 2003
    Posts
    834
    I don't know about any one else, but I couldn't understand the screenshot (you don't have to use a special screen-capture utility. Just press the 'Prt Scr' key on your keyboard and then paste it into your picture editor).

    I don't think a status bar comes with a JWindow (you're not talking about the browser's status bar are you?).
    ArchAngel.
    O:-)

  3. #3
    Join Date
    Sep 2003
    Posts
    5

    re:reply

    Thanks for the reply:

    I have attached a new bitmap, basically i have created a jwindow in which i am going to add a background image to - but my problem is the message java applet window allway appears - can i change this or remove the grey status bar it appears in. Hopefully the bitmap will make it more clearer.

    thanks
    fergal.
    Attached Images Attached Images

  4. #4
    Join Date
    Mar 2003
    Posts
    834
    It looks like you're running you're applet in AppletViewer.exe. It's AppletViewer which adds that message, not the applet itself. If you want to get rid of it put your applet inside some HTML.
    ArchAngel.
    O:-)

  5. #5
    Join Date
    Sep 2003
    Posts
    5

    re: reply

    No,

    I have it embeded in a html page and then launch the window.

    The window is borderless, i think maybe it could be something to do with the window style or borderlayout.

    MAINWINDOW = new JWindow();
    Dimension screen = getToolkit().getScreenSize();
    MAINWINDOW.setSize(550,550);
    \\center on screen
    MAINWINDOW.setLocation((screen.width - MAINWINDOW.getSize().width)/2, (screen.height - MAINWINDOW.getSize().height)/2);

    //add the panel created earlier
    MAINWINDOW.getContentPane().add(BUTTONPANEL, BorderLayout.CENTER);
    MAINWINDOW.setVisible ( true );

  6. #6
    Join Date
    Mar 2003
    Posts
    834

    Cool

    OK, but the point is that it's not the applet itself, it's the applet's container, providing information to the user about the origin of this window.

    To prove my point I wrote the following application (note - not applet):
    Code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    
    public class JWindowTest {
    	public static void main(String[] args) {
    		// Create the window
    		JWindow jw = new JWindow();		
    		jw.setSize(100, 100);		
    		
    		// Create a button
    		Button btnQuit = new Button("Quit");
    		btnQuit.addActionListener(new ActionListener() {
    			public void actionPerformed(ActionEvent e) {
    				System.exit(1);
    			}
    		});
    		// Add the button
    		jw.getContentPane().add(btnQuit, BorderLayout.CENTER);		
    		
    		// Show everything
    		jw.setVisible(true);
    	}	
    }
    Look - no status bar!
    ArchAngel.
    O:-)

  7. #7
    Join Date
    Sep 2003
    Posts
    5

    re:reply

    Yep i get your point, and see how the class reacts when compiled locally. But what i am concerned with is having it do the same within a html page on a window that popsup from the html page.

    I need the window to popup from the html page and to remove this bar that shows the origin. The window needs to popup and cannot stay within the html page.

    I can't see any code that allows me to achive this.

    thanks
    Fergal.

  8. #8
    Join Date
    Mar 2003
    Posts
    834
    "Yep i get your point, and see how the class reacts when compiled locally. But what i am concerned with is having it do the same within a html page on a window that popsup from the html page. "

    OK.

    "I need the window to popup from the html page and to remove this bar that shows the origin. The window needs to popup and cannot stay within the html page."

    I really don't think it can be done. What's the big deal? There are many commercial services that have it. Also, why can't it appear embedded in HTML (it's still dependant upon the parent window)?
    ArchAngel.
    O:-)

  9. #9
    Join Date
    Sep 2003
    Posts
    5
    Thanks ArchAngel,

    I suppose i could leave it - you see my app is supposed to be interactive and based on simulations and it just looks a bit messy. but i will just have to live with it.

    thanks
    Fergal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center