Maximizing JFrame on Linux OS

This is the same topic as in this thread
http://forum.java.sun.com/thread.jspa?threadID=734904&tstart=0
thanks

Dear Akshay,
When using a Linux OS, in transaction DC20 a separate frontend type and a path for processing originals in according with Linux OS specifications must be defined.                                                                               
In addition, the users must then select this front end types before they display an original. They can do this in the "Extras" menu with the menu command "Change frontend type". For this change it is important that the "HOSTNAME" variable is maintained for the MAC computer. On Windows computers, you can maintain this in the system control panel. This HOSTNAME value is then entered for the new frontend types and in future the user should then always use the new frontend type.
Best regards,
Christoph

Similar Messages

  • Maximize undecorated JFrame on linux

    Hello every one!
    I have a problem with maximizing undecorated window on all Linux OS. When I try to maximize my jFrame, it maximized for all screen size and cover task bar.
    How calculate screen bounds insets on linux? It's possible at all?
    JFrame jFrame = new JFrame();
    jFrame.setUndecorated(true);
    jFrame.setExtendedState(MAXIMIZED_BOTH);
    jFrame.setVisible(true);

    Strange. I once had the opposite problem on Windows...
    According to [this post|http://forums.sun.com/thread.jspa?messageID=10803082#10803082] , the following should return the size of the desktop screen, save for the task bar if any:
    GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds()You could then explicitly set the frame's bounds to this value. However I would assume that's already what setExtendedState(MAXIMIZED_BOTH) does...
    Edited by: jduprez on Apr 29, 2010 9:34 AM

  • Maximized JFrame obscuring task bar

    I have an application that obscures the windows taskbar when it is maximized (using the JFrame's own maximize button - NOT programmatically). The same happens when this.setExtendedState(JFrame.MAXIMIZED_BOTH) is called.
    J2SE 1.4.0 in windows 2000 is the environment (from what have read, maximize should work well in 1.4). I can create a brand new JFrame and mostly it works - is there some undocumented property that is causing it to maximize to the fullscreen instead of the usable screen?
    Thanks in advance.

    I was hoping that there was a way that made sure the JVM itself would do it (it works most of the time) - such a simple but important thing to end users should NOT require JNI code. Maximising on at least windows and macintosh (and most linux flavours) is pretty well defined - anyone that says it is a platform specific feature is just wrong - it can apply to any GUI system at least in some form.

  • Disable mouse or get fullscreen jframe in linux

    I am trying to create a login screen that will grant a user access to a particular application. For the login screen, I would like the ability to make the jframe run at fullscreen. I am able to do this on windows, but can't duplicate it on ubuntu linux. Since I am unable to get the code below to work on linux, maybe someone knows another way to get the same effect, or would it be possible to turn off the use of the mouse, not only on the jframe, but on the system itself?
    Thanks for the help.
    public static void main(String[] args) {
    // initialize the Graphic device to default one
            final GraphicsDevice myDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    // create the frame
            final JFrame test = new JFrame("Login Screen");
    // set recomended attributes
            test.setResizable(false);
            test.setUndecorated(true);
    // test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // we don't really need this because no mouse close is provided
            test.addKeyListener(new KeyAdapter() {
                @Override
                public void keyReleased(KeyEvent e) {
                    super.keyReleased(e);
    // code to kill off other events such as ALT-F4 on windows should go here
    // lets provide a way out for now
                    if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
                        myDevice.setFullScreenWindow(null);
                        test.dispose();
                        System.exit(0);
           System.out.println("before full screen");
    // query for supported
            if (myDevice.isFullScreenSupported()) {
                System.out.println("full screen supported");
                try {
                    myDevice.setFullScreenWindow(test);
                } catch (Exception e) {
    // if something goes wrong kill the window get back to desktop
                    myDevice.setFullScreenWindow(null);
                    e.printStackTrace();
        }

    Hi,
    I am not an expert and am trolling this site hoping to find the answer to my problem. However, I think that I might know the answer to this one.
    Open a site that has a flash application in it (like a you tube video). Right click on the flash window, select settings, and click the check box that selects "Enable hardware acceleration".  Doing this should improve the speed of video playback.
    Of course, it has done nothing for me since upgrading to Flash version 10.1, but it might work better for you.
    William

  • Maximized JFrame

    Hello!
    I'm wondering how can I launch JFrame already maximized ?
    jdk1.3.1
    I was told that in jdk1.4 there is special method for this operation.

    Hello!
    I'm wondering how can I launch JFrame already
    maximized ?
    jdk1.3.1
    I was told that in jdk1.4 there is special method for
    this operation.Not directly possible in 1.3.1. If you do a forum search you'll find two workarounds: via screensize and using robot.

  • Maximized Screen in Linux Java (GraphicsEnvironment)

    How do I maximized my Frame in Linux Environment??? Since there is no GraphicsEnvironment class available... Please Help me in this problem...

    Hi ,
    I have checked this will not work on Linux.
    i.e. the call
    setMaximizedState(Frame.MAXIMIZED_BOTH);
    does NOT work in Linux(RHEL 4.X).
    Can you please help me how to achieve the "MaximizedScreen" during the coming up of the UI in Linux?
    Thanks,
    -Bhaskar.

  • Maximizing JFrames

    I've been looking around the API and I haven't found a way to maximize a JFrame programmatically. The best I've done is figure out the screen size and setSize it, manually, but it's sill shows a maximize button. Anybody with any ideas? Or is this simply not possible?

    Try using Toolkit...
    Toolkit theKit = window.getToolkit();
    Dimension wndSize = theKit.getScreenSize();
    window.setSize(wndSize.width, wndSize.height);
    where window is a JFrame object...
    hope this helps...

  • JFrame (extended) state, iconified/maximized/normal question

    Greetings and salutations,
    I've been removing some rough edges from my last application and I noticed the
    following: before an application quits every location/size of the top level components
    is written to a file. When the application starts again everything is read back in
    again and the application shows itself just as it was before it closed the last time.
    There's one little quirck though:
    A JFrame can be in one of three states when an application quits:
    1) iconified; nothing is wrong here, i.e. the application comes back on in the same
    iconified state and after de-iconification the JFrame shows up the same as
    before the previous quiting.
    2) 'normal': same as above: the JFrame shows up identical as before quiting
    the application the previous time.
    3) maximized: the new incarnation shows up as a maximized JFrame, but after
    'demaximalization' (sorry) the JFrame keeps its maximum size, i.e. if still fills up
    the entire screen.
    Before quiting I save the bounds, the state and the extended state of a JFrame
    and reinstate these values after a new incarnation of the application. I think I've
    tried all 2^3 == 8 possible permutations of this all, but option 3) keeps giving
    me trouble, i.e. the bounds don't work after 'demaximalization'.
    Ideas anyone?
    kind regards,
    Jos

    Here's a test program for people who want to experiment around a bit, but are reluctant to create a test class:import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class Test extends JFrame {
        public Test () {
            setDefaultCloseOperation (WindowConstants.DISPOSE_ON_CLOSE);
            setTitle ("Test");
            WindowInfo windowInfo;
            try {
                windowInfo = read ();
            } catch (Exception exception) {
                System.err.println ("couldn't read window.info");
                windowInfo = new WindowInfo ();
            setLocation (windowInfo.location);
            setSize (windowInfo.size);
            setExtendedState (windowInfo.extendedState);
            addWindowListener (new WindowAdapter () {
                public void windowClosing (WindowEvent event) {
                    try {
                        write (new WindowInfo (getLocation (), getSize (), getExtendedState ()));
                    } catch (Exception exception) {
                        System.err.println ("couldn't write window.info");
            setVisible (true);
        public static void main (String... parameters) {
            new Test ();
        private WindowInfo read () throws ClassNotFoundException, IOException {
            ObjectInputStream in = null;
            try {
                in = new ObjectInputStream (new FileInputStream ("window.info"));
                return (WindowInfo) in.readObject ();
            } finally {
                if (in != null) {
                    try {
                        in.close ();
                    } catch (IOException exception) {}
        private void write (WindowInfo windowInfo) throws IOException {
            ObjectOutputStream out = null;
            try {
                out = new ObjectOutputStream (new FileOutputStream ("window.info"));
                out.writeObject (windowInfo);
            } finally {
                if (out != null) {
                    try {
                        out.close ();
                    } catch (IOException exception) {}
        private class WindowInfo implements Serializable {
            public Point location;
            public Dimension size;
            public int extendedState;
            public WindowInfo () {
                size = new Dimension (600, 400);
                Dimension screenSize = Toolkit.getDefaultToolkit ().getScreenSize ();
                location = new Point (screenSize.width / 2 - size.width / 2, screenSize.height / 2 - size.height / 2);
                extendedState = NORMAL;
            public WindowInfo (Point location, Dimension size, int extendedState) {
                this.location = location;
                this.size = size;
                this.extendedState = extendedState;
    }Note that I fooled around myself a bit too.

  • Making components NOT resizable,  forcing certain components to be resized

    Basic setup -
    A maximized JFrame with BorderLayout, a JPanel added to the contentPane in location BorderLayout.WEST, and another container in BorderLayout.EAST (not that it should matter much).
    In the JPanel in the western side, I have it set up with a BoxLayout going down along the Y axis, and in order, I have a JPanel (with a few JLabels inside), a JPanel with a JLayeredPane that uses GridLayout, and a blank JPanel to fill up space (remember, the parent frame is maximized).
    What happens is that my JPanel with the JLayeredPane gets stretched (and distorted) out to the bottom of the frame, when what I want is that the empty JPanel gets stretched and fills up the empty space.
    Is there a way to "lock" the layered pane's size so that it doesn't get stretched? Which layout should I use, or how can I make the JPanel take up the empty space? I suppose I could set the empty panel's preferred height to Integer.MAX_VALUE, but that seems like a rather messy solution.
    Also... sometimes when I click on the JLayeredPane (which is a gridlayout of JPanels) and I remove a component from one of the JPanels, the whole layout gets shifted over and really distorted (not stretched, but jumbled). I've narrowed the problem down to something to do with validation/revalidate. Would anyone happen to have an idea of what's going on?
    Thanks

    I had already tried using glue, but it did nothing so I switched over to the filler JPanel, but that obviously didn't help much, but wonderfully enough, once I set the JPanel with the JLayeredPane to have a FlowLayout instead of a BorderLayout, glue worked!
    So, now that that's over with, anyone have any ideas about the validation issues... like how to prevent things from revalidating, etc...?

  • Linux / Gnome - problem with moving JFrame ?

    I have a swing application which runs fine on Windows. Yesterday I tried it on a Fedora Linux (latest version) with Gnome, running Java 1.5.0_02 and I noticed the following weird problem. When you try to drag a JFrame window by the title bar to move it, it always maximizes it! When you bring it back to regular size, you see that the window was actually moved, but after that it was maximized, as if you double-clicked the title bar. It only happens with Java windows, all other X11 applications behave normally.
    Anybody else have the same problem?

    Btw, it only happens if you specify that you want JFrame and JDialog decorated:
    setDefaultLookAndFeelDecorated(true)
    As much as I like the new 1.5 Swing decorations I guess I will have to stick to no decorations under Linux.

  • JFrame which does not allow resizing (maximizing, minimizng)

    I want to develop a login frame which does not allow resizing (maximizing, minimizing as this does not make sense) and with 2 fields, JTextField and JPasswordField.
    The frame is developed but has the usual resizing handles.
    How to do?
    Many tks for any information.
    John Pashley

    Don't use a JFrame. Also, don't expect code like this again; I did it for fun.
    It requires your modification.
    * Title:        Login Screen<p>
    * Description:  Login Screen<p>
    * Class:        Login ScreenLoginScreen<p>
    * Copyright:    who cares<p>
    * Company:      who cares<p>
    * @author who cares
    * @version who cares
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.util.Vector;
    import java.io.File;
    import javax.swing.*;
    public class LoginScreen extends JDialog implements ActionListener, FocusListener
       private JTextField      name;
       private JPasswordField  password;
       private JButton         loginButton;
       private JButton         cancelButton;
       private JDialog         thisDialog = this;
       private ImageIcon       splashImage;
       private String          appTitle;
       private int             logCounter;
       public LoginScreen()
          super();
          this.toFront();
          setTitle("Login");
          addWindowListener(new WindowAdapter()
             public void windowClosing(WindowEvent e)
                    System.exit(0);
          getContentPane().setLayout(new BorderLayout());
          splashImage = new ImageIcon( getClass().getResource("images" + File.separator + "image.jpg")) );
          getContentPane().add(new JLabel(splashImage), "North");
          getContentPane().add(makeLoginPanel(), "Center");
          getContentPane().add(makeButtonPanel(), "South");
          pack();
          setResizable(false);
          setLocationRelativeTo(null);
          setVisible(true);
        * make login panel
       private JPanel makeLoginPanel()
          JPanel loginPanel = new JPanel();
          JLabel label;
          loginPanel.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 20));
          GridBagLayout gbl = new GridBagLayout();
          GridBagConstraints gbc = new GridBagConstraints();
          loginPanel.setLayout(gbl);
          gbc.weightx = 1.0;
          gbc.fill = GridBagConstraints.HORIZONTAL;
          gbc.insets = new Insets(0, 5, 10, 5);
          gbc.gridx = 0;
          gbc.gridy = 0;
          label = new JLabel("Login Name:", SwingConstants.LEFT);
          gbl.setConstraints(label, gbc);
          loginPanel.add(label);
          gbc.gridx = 1;
          name = new JTextField("insider", 10);
          name.addFocusListener(this);
          gbl.setConstraints(name, gbc);
          loginPanel.add(name);
          gbc.gridx = 0;
          gbc.gridy = 1;
          label = new JLabel("Password:", SwingConstants.LEFT);
          gbl.setConstraints(label, gbc);
          loginPanel.add(label);
          gbc.gridx = 1;
          password = new JPasswordField("insider",10);
          password.addFocusListener(this);
          gbl.setConstraints(password, gbc);
          loginPanel.add(password);
          return loginPanel;
        * make button panel
       private JPanel makeButtonPanel()
          JPanel buttonPanel = new JPanel();
          buttonPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
          //make LogIn button
          loginButton = new JButton("Login");
          loginButton.setActionCommand("Login");
          buttonPanel.add(loginButton);
          rootPane.setDefaultButton(loginButton);
          loginButton.addActionListener(this);
          this.getRootPane().setDefaultButton(loginButton);
          //make Cancel button
          cancelButton = new JButton("Cancel");
          cancelButton.setActionCommand("Cancel");
          buttonPanel.add(cancelButton);
          cancelButton.addActionListener(this);
          this.addKeyListener(new KeyAdapter()
             public void keyReleased(KeyEvent e)
                if(e.getKeyCode() == KeyEvent.VK_ESCAPE)
                   cancelButton.doClick();
             return buttonPanel;
        * Action handler for login and cancel buttons
       public void actionPerformed(ActionEvent e)
          JButton btn = (JButton) e.getSource();
          if (btn.getActionCommand().equals("Login"))
             // Because login() process happens before swing process (above),
             // force it to happen "later"
             SwingUtilities.invokeLater(new Runnable()
                public void run()
                   login(); //create this method, okay?!
          else if (btn.getActionCommand().equals("Cancel"))
             System.exit(0);
        * Focus gained handler for username and password buttons
       public void focusGained(FocusEvent e)
          JTextField tf = (JTextField) e.getSource();
          tf.selectAll();
        * Focus lost handler for username and password buttons
       public void focusLost(FocusEvent e) {}
       private void showErrorMessage(String message, String header)
          JOptionPane.showMessageDialog(getContentPane(),
                                        message, header,
                                        JOptionPane.ERROR_MESSAGE);
        * This method controls the cursor for login window. If isWait is set to
        * true, dialog's cursor is set to Cursor.WAIT_CURSOR. If isWait is set
        * to false, the cursor is set ta Deafult.
        * While the window is in WAIT mode, this method will also disable Login
        * and Cancel buttons to ensure the user does not accidently request
        * a cancel while loging in or launching a second login.
       private void setWaitCursor(boolean isWait)
          /* In order to disable login and cancel buttons while logging in to the
             application, this method will temporarely change action commands and
             reset them when login process failed to give user another chance.
             Note: Disabling the buttons by calling setEnabled(false) did not work
             since login() method is called from an action event handler and the
             process will not be released to AWT until login method is complete.
          if (isWait)
             this.getGlassPane().setCursor(new Cursor(Cursor.WAIT_CURSOR));
             this.getGlassPane().setVisible(true);
             loginButton.setActionCommand("none");
             cancelButton.setActionCommand("none");
          else
             this.getGlassPane().setCursor(Cursor.getDefaultCursor());
             this.getGlassPane().setVisible(false);
             loginButton.setActionCommand("Login");
             cancelButton.setActionCommand("Cancel");
    } //end loginscreen

  • How to bring a JFrame up maximized?

    if you have a class like this:
    public class myClass extends JFrame {
    //some components
    public myClass() {
    //add some components
    setVisible(true);
    how can you make this JFrame to appear maximized?
    SJG

    There may be another way, but try this:
    this.setSize(new Dimension((int)screenSize.getWidth(), (int)screenSize.getHeight() );

  • JFrame icon won't change in linux

    In windows, I'm able to change my JFrame's icon with the setIconImage(Image) but doing the same thing on linux (Gnome) does nothing. Is this a bug or is there something else I need to do to change an icon in a JFrame?

    In windows, I'm able to change my JFrame's iconwith
    the setIconImage(Image) but doing the same thingon
    linux (Gnome) does nothing. Is this a bug or is
    there something else I need to do to change anicon
    in a JFrame?Works for me! FC5 JKD1.4,1.5 and 1.6 beta.Are you able to change the icon of the JFrame after it's been set visible, or only as an initializing step? I can do the latter, but not the former. The icon never changes from what it originally set to.

  • JFrame maximizing - non deterministic behaviour

    Hi there,
    I wonder why in the following code the componentResized Method gets a JFrame instance wthich's extended state is MAX_BOTH and the componentMoved Method NORMAL.
    Does someone have an explanation or an work around for storing the last position of the JFrame (to store in preferences in order to load them again).
    Here is a minimal example.
    import javax.swing.JFrame;
    * @author Karlheinz Toni
    public class Test {
        public static void main(String[] args) {
            JFrame mainFrame = new JFrame();
            mainFrame.addComponentListener(new ComponentAdapter() {
                 * (non-Javadoc)
                 * @see java.awt.event.ComponentAdapter#componentMoved(java.awt.event.ComponentEvent)
                public void componentMoved(ComponentEvent e) {
                    // TODO Auto-generated method stub
                    super.componentMoved(e);
                    printExtendedState(e.getComponent(), "moving");
                 * (non-Javadoc)
                 * @see java.awt.event.ComponentAdapter#componentResized(java.awt.event.ComponentEvent)
                public void componentResized(ComponentEvent e) {
                    // TODO Auto-generated method stub
                    super.componentResized(e);
                    printExtendedState(e.getComponent(), "resizing");
                private void printExtendedState(Component component,
                        String whatDoIDo) {
                    if (component instanceof JFrame) {
                        System.out.println("Extended state for " + whatDoIDo + ":"
                                + ((JFrame) component).getExtendedState());
            mainFrame.setVisible(true);
    }I would be greatful to any help ;)
    Sincerely
    Charly

    I was playing with exactly this kind of thing last night and discovered that the order you get the events isn't really guaranteed. I solved this by using a swing Timer to wait for 1 second of inactivity before querying the Frame and updating the user preferences. Here's the chopped down version of my code:
    I register a GeometryTracker object as a ComponentListener and a WindowStateListener in the frame to be monitored.
    This all seems to work quite well, but I'm still seeing differences between windows and OS-X for example. (on OS-X the maximized state doesn't seem to correlate with reality. If anyone knows of a trick I'd love to see it.
    Thanks and I hope this helps!
    Cheers,
    Seve
    import javax.swing.Timer;
    public class GeometryTracker
        extends ComponentAdapter
        implements WindowStateListener
        private Frame       frame;
        private Preferences framePrefs;
        private int         frameState = 0;
        private Rectangle   frameBounds;
        private Timer       updateTimer;
        // TODO: problem with setting up the preferences once like this: changes to screen size aren't handled
        public GeometryTracker( Frame targetFrame ) {
            frame                  = targetFrame;
            framePrefs             = Preferences.userNodeForPackage( frame.getClass() );
            frameState             = frame.getExtendedState();
            frameBounds            = frame.getBounds();
            updateTimer            = new Timer( 1000, new AbstractAction() { public void actionPerformed( ActionEvent e ) { updatePrefs(); } } );
        private synchronized void updatePrefs() {
            frameState = frame.getExtendedState();
            // don't update the window size/location if it has been maximized
            if( ( frameState & Frame.MAXIMIZED_BOTH ) == 0 ) {
                frameBounds = frame.getBounds();
            framePrefs.putInt( "x",      frameBounds.x      );
            framePrefs.putInt( "y",      frameBounds.y      );
            framePrefs.putInt( "width",  frameBounds.width  );
            framePrefs.putInt( "height", frameBounds.height );
            framePrefs.putInt( "state",  frameState         );
            updateTimer.stop();
        public void setBounds( Rectangle defaultBounds ) {
            Rectangle r = new Rectangle();
            r.x         = framePrefs.getInt( "x",      defaultBounds.x      );
            r.y         = framePrefs.getInt( "y",      defaultBounds.y      );
            r.width     = framePrefs.getInt( "width",  defaultBounds.width  );
            r.height    = framePrefs.getInt( "height", defaultBounds.height );
            frameState  = framePrefs.getInt( "state",  Frame.NORMAL );
            frame.setBounds( r );
            if( ( frameState & Frame.MAXIMIZED_BOTH ) != 0 ) {
                frame.setExtendedState( frameState );
        public void componentMoved( ComponentEvent e ) {
            updateTimer.setDelay( 1000 );
            updateTimer.start();
        public void componentResized( ComponentEvent e ) {
            updateTimer.setDelay( 1000 );
            updateTimer.start();
        public void windowStateChanged( WindowEvent e ) {
            updateTimer.setDelay( 1000 );
            updateTimer.start();
        }

  • Jframe titlebar is not visible on linux.

    Hi all,
    I am developing a GUI application in java for Linux platform. And while i execute my code on linux then the title bar (which contains information about page in left and minimize,maximize and close button in right) is not visible. While it is visible when i put the same code on windows.
    On linux Jinternal frame instance is showing title bar but Jframe instace is not and that is a problem for my main GUI window.
    Please help me how to make titlebar visible on linux or what i am doing wrong.
    Thanks in advance.
    Note: I am accesing linux terminal thrugh Xstart(An xterm based interface).
    Edited by: Mavens on May 20, 2008 9:09 AM

    Can you test whether the display is the same on a Linux box accessed directly (rather than through the remote client)?
    Can you post sample code? Details about your flavor, window manager, etc.?

Maybe you are looking for

  • Managing Large iMovie Projects

    I am working on a project that will be about 45 min.  I am currently at 12.5 minutes and already have TONS of media - hundreds of pictures, multiple short video clips, music and sound clips.  I don't want to lose it in the making.  Here are my questi

  • Cannot view email attachments unless....

    I have been experimenting sending various word and Excel sheets as attachments and opening them in Mail on the iPhone. The documents I send without an extension in the filename ( .doc or .xls) cannot be viewed on the iPhone, but if I send the same fi

  • How to enable/allow IPv6 ping requests

    My IPV6 provider sixxs.net needs to ping my end of the IPV6 connection. It looks like the working AEBS tunnel that I have setup is not responding to pings. Strangely the public IPv4 address seems quite happy to respond. How can I get the AEBS to resp

  • WF not sending the email notifications.

    Hi DBAs, How and where to check whether Workflow Mailer account is locked or not. Thanks -Samar-

  • Apple usb wired keyboard not working for MBP pro w/ 0 for stop on numeric k

    Just got logic 8 and noticing that it does load up quicker with the new os update. I'm going through the first getting started manual and I have a apple usb keyboard attached to my mac book pro. When I press 0 on the numeric keypad it doesn't stop th