I'd like to create a custom swing component such as a desktop widget which does not require a JFrame (or to extend it) to be printed on the screen.
I don't want to extend the JFrame because my component is really simple and JFrame implements a lot of functionality I dont need.
Who do I start? Which class should I extend?
Many Thanks
EDIT ---------------------------------------
Thanks guys!
I'll check the references you sent. Also, is it possible to java to draw on the screen without swing API?
If you don't want the functions a JFrame provides and just want floating graphics then use a JWindow. It does not have window decorations.
Example with plain label in a JWindow:
public static void main(String args[]) {
JWindow w = new JWindow();
w.add(new JLabel("Testing a Window!!!!!"));
w.setLocation(300, 300);
w.pack();
w.setVisible(true);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With