Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    7
    Rep Power
    0

    Default JDialogs within Component

    Hi,

    I've created an undecorated JDialog class that acts as a sticky-note which is displayed when the user right-clicks on a chart (this is a subclass of JLabel). This is a new feature that I've added in recently, and I already have a printing feature built into the system. The thing is I want to be able to print the sticky-notes placed on the screen, but to do this I'd need to make the sticky-notes children of my chart controls (which doesn't seem possible as a JDialog can only be a child of other windows).

    Is there any way I could either print everything that lies within the area of the chart control (including the sticky-notes which aren't children of it), or somehow make the sticky-notes children of the chart control?

    Thanks in advance!

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    What chart controls are you talking about.

  3. #3
    Join Date
    Aug 2009
    Posts
    7
    Rep Power
    0

    Default

    I've created my own, which is a subclass of JLabel.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    So it depends on how you have created your chart control and how you want the notes to be merged with what is already on the "chart". I suppose the notes are purely text?
    You could write a prepareForPrinting function that creates a 'printable chart' by merging the current chart with the sticky notes. You print function would then work on the 'printable chart' object.

Similar Threads

  1. the component does not show
    By shruti in forum AWT / Swing
    Replies: 8
    Last Post: 07-08-2009, 01:21 PM
  2. add component to component
    By Omarero in forum New To Java
    Replies: 7
    Last Post: 05-17-2009, 03:39 PM
  3. Find Component by name
    By amjad905 in forum Advanced Java
    Replies: 9
    Last Post: 04-25-2009, 06:55 PM
  4. Same component on all JTabbedPane
    By java_novice in forum AWT / Swing
    Replies: 4
    Last Post: 08-06-2007, 10:09 AM
  5. Help with custom component
    By Falcon1 in forum AWT / Swing
    Replies: 8
    Last Post: 07-21-2007, 01:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •