Open « JFrame « Java Swing Q&A





1. how do you open web pages in java?    stackoverflow.com

Is there a fairly simple way to open a web page within a GUI's JPanel? If not, how do you open a web page with the computer's default web browser? I am ...

2. opening 2 frames just with one object    stackoverflow.com

this a a part of my code ,but i don't know that why it shows two chat frames for me when i click on the list? also this is a client/server application ...

3. How to make "Open File..." window in netbeans PLATFORM?    stackoverflow.com

I need to create something like internal frame in netbeans platform, which loads file from any location. I tried it by jInternalFrame, but I was not able to find some container to ...

4. Reactivate frame instead of open a new one    stackoverflow.com

Hi I've got a MainWindow with a JTable, which is a list of Stuff. If you doubleclick on one of them, there is a detailView which open a new Frame (in a ...

5. open web page from jframe    stackoverflow.com

hello is there a way to open a web page in the browser from jframe that contain a button or label so when the user click the button or label the web ...

6. how to stop opening of duplicate window using Smack API in swing?    stackoverflow.com

I have 2 swing classes which extends JFrame. Both have show() method in there constructor. From ClassOne i called ClassTwo like new ClassTwo() on button click event. But if i press ...

7. One JFrame opening another    stackoverflow.com

I have a JFrame and JPanel full of Jsomethings with an actionlistener. When the user clicks an object I want to open another JFrame. Here is what I did:

public void actionPerformed(ActionEvent ...

8. How to destroy the previous frame open opening a new frame    stackoverflow.com

I am building an application in java that has 2 JFrames. 1st frame has a button that upon clicking should open the next JFrame while the previous one should close. I ...

9. Open a program in a Java frame    stackoverflow.com

I want to open a program in a new frame in Java, for example: I want to open the Notepad.exe with Java, that's easy, but it opens a Notepad.exe window, I ...





10. Is there a safe, programmatic way to determine if it's safe to open a Swing window?    stackoverflow.com

I have a java app that the user might invoke from the command line by running java -jar app.jar or from a desktop environment by double-clicking the .jar file. I would ...

11. Opening a native app within a JFrame    stackoverflow.com

I have a fullscreen app that needs to open edrawings, is it at all possible to load edrawings within the Java app so that as soon as the user closes the ...

12. Calling a separate Java file to open a second gui window    stackoverflow.com

I currently have a java file that has buttons to create new GUI windows. I have a second java file that is in the same project that I would like to ...

13. Turning a JFrame black when opening another window    stackoverflow.com

I wan't to make my main JFrame become darken when the focus is on another window. This is an example from the game Football Manager 2012. First the main window is selected ...

14. How to open pdf file in Jframe using itext    stackoverflow.com

I would like to open a pdf file in a new Jframe. the pdf file exist. I just need to open it and show it in a new Jframe. I user itext ...

15. [platform-dev] How to open a filetype into another JFrame window?    forums.netbeans.org

Hi, I have a new filetype that I've created and the default openCookie() opens it up in an editor panel in the editor tab. However, I want to have it open ...

16. Opening new Jframe in existing window    forums.netbeans.org

You cannot open a JFrame inside another JFrame. Try using JPanels for different views within a JFrame. JFrame is a top level Component. On Fri, Mar 18, 2011 at 2:52 AM, Mazara wrote:





17. Opening a JFrame maximized    coderanch.com

Hi Sanjay, using the above code i will get a frame which is of the full screen size. i am working on the windows platform, and when i want to maximize, i want to take into consideration the windows taskbar(start menu). that is, the maximize should work the same way as would a normal windows application. also, if a user clicks ...

19. open new window    coderanch.com

20. opening new frame    coderanch.com

hello all, i have an application made in swing using frames. i have a button on it. what i want to do is on the click event of the button,i want to open a new frame and kill this frame. can anybody help me how to do this?? thanks in advance. sachin

21. How can a small frame remain open in a big frame    coderanch.com

Hello everybody, I have a main frame and there is another small frame wich acts as a small tool selecting window. and after selecting the tool from small frame when i take my mouse to main frame the small frmae is minimized or goes behind the main frame . how can my small frmae remain visible on main frame even after ...

22. Problem with Open a New Window??    coderanch.com

23. How to open a Maximised Window (urgent)    coderanch.com

24. Problem re-opening a JFrame    coderanch.com

25. Open a new Window?    coderanch.com

26. opening multiple frames in a loop    coderanch.com

It sounds to me like you are creating some sort of a "wizard" where you might have a next button, or in your case, a close button that activates the next part of the wizard. You can't really pause a for loop. What you might do is add a windowlistener to your frames and on the windowsClosing or windowClosed events, generate ...

27. View new frame while open a frame?    coderanch.com

28. Opening new JFrame    coderanch.com

29. opening a window on mouse over    coderanch.com

30. opening link in new window    coderanch.com

using this code, i added like this to my panel: private JEditorPane getJEditorPane() { if (jEditorPane == null) { jEditorPane = new JEditorPane(); jEditorPane.setBounds(new Rectangle(84, 162, 212, 109)); jEditorPane.setEditable(false); jEditorPane.setDocument(new HTMLDocument()); jEditorPane.setEditorKit(new HTMLEditorKit()); jEditorPane.setText("google"); jEditorPane.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { JEditorPane pane = (JEditorPane) e.getSource(); if (e instanceof HTMLFrameHyperlinkEvent) { HTMLFrameHyperlinkEvent evt = ...

31. Opening a child window from a window    coderanch.com

Hi, I am trying to open a child window from a window based on the action performed in main window. Child window is getting created, but noting is displayed in it. When we increase the size of the child window, then it gets displayed. Pls. Help me as soon as possible. Its very urgent Thanking you Raj

32. Click to open another window, what is the problem with my ActionListen?    coderanch.com

Hello everybody, I think that my question is simple, but I've tried a lot to know the problem! I hope that somebody can help me.. I am using NetBeans IDE 6.1. I have 2 swing JFrames, Window1 and Window2. The first one contains a button which supposes to open the other JFrame whenever it is clicked. I have used the ...

33. Open New Window    coderanch.com

Hi All, I want to open a new window on the click of a button("finish"). At the same moment I want to close my parent window from where the swing application opened initially and now open the new one. Please suggest me the way by which I can do the same. Thanks Kushagra

34. Opening new class (JFrame) from old one    coderanch.com

35. Opening a new window.    coderanch.com

Hi everyone Im trying to get a new window to open once I click the Add Customer button in my first window, but I have no idea how to do it. Could someone point me in the right direction? Cheers Ian Here's my code so far: import javax.swing.*; import java.awt.*; import java.awt.event.*; public class AirlineGUI extends JFrame implements ActionListener { Airline ...

36. coding a texteditor: want to open a separate option window    coderanch.com

The code below is a simple frame that has a button. when i click the button i want to open a dialog with options (including checkboxes, and combobox) . can you please tell me how to create and show that dialog . I am still not able to understand how to use Jdialog box . If i get to understand this ...

37. open new window    coderanch.com

38. Opening a JFrame    coderanch.com

Heres sample code import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class ZZZ extends JFrame { public SmallFrame smallFrame; public ZZZ() { JButton button = new JButton("Press me"); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { if(smallFrame == null) { smallFrame = new SmallFrame(); } else { smallFrame.reset(); } } }); JPanel panel = new JPanel(); ...

39. How Donot open JFrame More then one time? please help    coderanch.com

Hi, I am developing one Desktop Application Using Swing. In my application, I designed Menu frame, whenever i click one menu_item respective page will load, suppose again i click same menu_item then one more same frame is opened.But i need only one frame , if already exist then i will show one pop_up Dialog to display "Already opened" or to show ...

40. How Donot open JFrame More then one time? please help    coderanch.com

Hi, I am developing one Desktop Application Using Swing. In my application, I designed Menu frame, whenever i click one menu_item respective page will load, suppose again i click same menu_item , if the frame already exists then i will open already opened frame otherwise it will open new frame. please help how to perform above things?

41. is it possible to give info window in Open Street Maps in Java swing application    coderanch.com

Hello everyone i am using a swing application where i displayed Open Street Maps. Now i need to display info window in the OSM. Could anyone help me, so that i can able to give info window in the OSM. is it possible to give info window in OSM. Did i need to use plugins for that. I am using eclipse ...

42. Open JFrame from servlet    coderanch.com

43. Open JFrame    java-forums.org

Hi, I got a problem. I want my program too start with Text and a start button. When the start button is called it should open a new JFrame with the game. Here is the main class: Java Code: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class GregerSnake extends JFrame{ private Board field = new Board(); private JButton[] button = new ...

44. diapose the child frame if already opened or block to open a new one    java-forums.org

Do you want instead to use a modal JDialog here instead of a JFrame? That would prevent any action from occurring on the main GUI until the dialog has been completely dealt with. Or if you must use a non-modal dialog, you could disable the button, and attach a listener to the dialog to see when it closes, and then re-enable ...

45. How do i open JFrame in the same active window    java-forums.org

Hello, I'm new to java and I'm having a project for school. Required to do design a waste collecting system which take in weight and print invoice to text file. So my 1st question is: How do I open JFrame, one after another, in the same active window ? for example this is the startup page then, when click on New ...

46. how to open one frame to another frame    java-forums.org

47. how to open a new JFrame from a JFrame    java-forums.org

Hi, so I want to make this kind of "webpage" using GUI for a standalone program. this program contains a login page, and if login successful, it will go to a panel of buttons. one of the buttons to open my existing program called FileExplorer which displays my comp files and folders. problem is, i don't know how to open up ...

48. opening a Jframe form in a top of a new form    java-forums.org

JFrame frame = new JFrame(); JLabel lblimage = new JLabel(new ImageIcon(image)); lblimage.setVisible(true); // JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(lblimage); // // add more components here frame.add(mainPanel); // frame.setSize(300, 500); frame.setVisible(true); so this image is in my one form. i want to show it in another form. i mean the whole form should display in top of the other form. is ...

49. wayyyyyy too many jframes opening!!    forums.oracle.com

It's doing exactly what you tell it to do. Your current code is creating a new processText JFrame everytime a non-happy word is encountered and two processText JFrames everytime a happy word is found. You need to rewrite this, but better, you need to think through your logic on paper before typing in code. This is something that would be best ...

50. JFrame opening multiple times - strange bug    forums.oracle.com

To be honest I don't know... I can only imagine that Swing is holding references to your Frame's, so when you create a new Frame within the application it get's it's knickers in a twist because your references point to your new instance but Swing's references point to all known jFrames. Try actually destroying the jFrame when the user closes it. ...

51. Opening existing jFrame on click    forums.oracle.com

I have got two different jFrames in a project using netBeans. I want my SHOP.java to open when I click a button on my LOGIN.java. In the login i have a jFrame with two buttons. And the SHOP has a jFrame. Perhaps there is just a different way to do it all together but I am not a strong programmer and ...

52. Opening JFrames as objects one at a time    forums.oracle.com

So the real issue is that you need each question to open in a modal dialog. AFAIK there is no nontrivial way of making a JFrame modal, so you might want to look at using JDialog instead, with a parent JFrame constructed in main(...). If you're in a hurry, this hack worked for me: in the main method, after instantiating each ...

53. open new jframe    forums.oracle.com

hey all, I have a jframe called anaPencere and it have some tabs..and in the one of tab, it called jTabbedPane4, I have a button. by this button , it called jButton25, I want to open a new jFrame from existing(anaPencere). I designed a jFrame in izin.java but I couldnt access it from anaPencere by code. how can I open izin.java ...

54. open JFrame    forums.oracle.com

Don't paint by calling getGraphics as it's a recipe for disaster and NPE. You really should do painting the correct way: subclass JPanel or JComponent, override their paintComponent method, and paint from within this method using the Graphics object passed in the method parameter. If this doesn't make sense then run, don't walk to the nearest Sun Swing Graphics tutorials to ...

55. Opening JFrame    forums.oracle.com

56. Opening new JFrame    forums.oracle.com