You could use SwingUtilities.getWindowAncestor(...)
method that will return a Window that you could cast to your top level type.
JFrame topFrame = (JFrame) SwingUtilities.getWindowAncestor(this);
More Related Contents:
- How to have an interactive map in JFrame
- The Use of Multiple JFrames: Good or Bad Practice? [closed]
- JComponents not showing up with picture background?
- How to make a JFrame Modal in Swing java
- Best practice for setting JFrame locations
- Java Bouncing Ball
- JTable not showing up on JFrame (Java)
- Why to use SwingUtilities.invokeLater in main method?
- Passing values between JFrames
- JPanel repaint issue
- Printing a JFrame and its components
- Layering multiple GlassPane’s in a Root Container
- Limiting the number of characters in a JTextField
- How to change JFrame icon [duplicate]
- KeyListener, keyPressed versus keyTyped
- How to change the color of titlebar in JFrame?
- Java center text in rectangle
- Java – How to create a custom dialog box?
- Only allowing numbers and a symbol (-) to be typed into a JTextField
- Why are my items not showing up in JFrame?
- Java Container remove method not working correctly
- How to add an image to a JFrame title bar?
- Java JFrame .setSize(x, y) not working?
- How can I customize the title bar on JFrame?
- How to add multiple components to a JFrame?
- How to minimize a JFrame window from Java?
- how to create own file with icon that inherit from JFrame icon, that I set it, in java and my own file use FileOutputStream and ObjectOutputStream
- JFrame: get size without borders?
- Why do we need to extend JFrame in a swing application?
- What is the relation between ContentPane and JPanel?