• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Creating a resizable panel in a corner of a frame

 
Greenhorn
Posts: 18
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

I was working on a small GUI program and wanted to create a small output panel similar to the console of Eclipse - when it is not locked into the "sidebar."

The two things I'd like to emulate are:
  • in one corner
  • above other items

  • and if possible, the fact that it can be resized.

    I've successfully placed a component (for example, a JLabel) above my main contents using a JLayeredPane, but is there any other existing component I could use to create something like this, or something similar?
    If not, how would I go about doing this?

    Thanks
     
    Rancher
    Posts: 3324
    32
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Create a non-modal JDialog.

    It works just like a JFrame, but is a child window to the frame. The user will be able to resize it and move it around the desktop.
     
    Dan Kao
    Greenhorn
    Posts: 18
    Eclipse IDE Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Sorry - I just realized I made a mistake and didn't use the correct terminology in my question.
    What I meant to ask was, is it possible to have a resizable panel that is only locked to one corner, as opposed to the entire side.

    For example,


    as opposed to


    (in the first image, the console is "floating" above the text and is not part of the sidebars, and in the second it is locked to the side.)
    Is this possible using Swing components?

    (I'm not sure if these solutions would be viable, but I've considered an invisible JDesktopPane and a JInternalFrame to do the job, and a JTextArea in a higher layer on which I could call setBounds(), which I know isn't recommended.)

    TIA
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic