Frame 1 « JFrame « Java Swing Q&A





1. Is there a way to "attach" Swing frames to one another?    stackoverflow.com

We have a program with multiple top-level swing windows (frames). We are adding some "debug mode" where for each window of the original application there should be a specialized window that displays ...

2. pop a frame    stackoverflow.com

I am working on a project (Java, Swing) in which i have to pop a frame on clicking a hyperlink. but the coding for the frame and all its components is ...

3. Create a setup-frame in Java    stackoverflow.com

My problem is the following: I have a Java application, and I would like to create a setup form on it, so i can declare some variables. How can it be done? ...

4. Access a new frames methods    stackoverflow.com

This method shows a new window in my application:

public void ShowNewCustomerView() {
    if (NewCustomer == null) NewCustomer = new NewCustomerView(this);
    NewCustomer.setVisible(true);
}
The class NewCustomerView has this ...

5. why the frame will confused!![:-)]    stackoverflow.com

these are my classes.when i run my MainClient class,one frame will be shown that get text from client and then send it to the server.at the first time when i click ...

6. FEST-swing example doesn't work, frame.isShowing() return false    stackoverflow.com

Try to use the FEST-Swing for Swing GUI testing, and using example from http://easytesting.org/swing/wiki/pmwiki.php?n=FEST-Swing.LaunchFromMain Unfortunately the frame.isShowing() always return false though I already see the JavaApp Swing is running See my ...

7. How to get Kerberos TGS and use it in a GUI application in JAVA?    stackoverflow.com

i'm trying to make an application with the Keberos protocol and the GSS-API in Java, and i've already made the authentication and the context establishement before calling the doAsPrivileged method. In this ...

8. Items not Appearing in New Frame in Java    stackoverflow.com

I'm building a JFrame that will eventually display the output of a program that has a variable number of sections in it. I have parsed the output but displaying it in ...

9. Sliding Frame effect in Java Swing    stackoverflow.com

Is there already workable example of a swing component which allows adding boxes/panels and then animate them to produce a sliding frame effect? What I am looking for is a simple component. ...





10. Moving from one frame to another in JAVA    stackoverflow.com

i want to move form one frame to another in java for example when i press the button ok it will move to another frame in which form will open. ...

11. Deiconifying a Frame    coderanch.com

Does anyone know how you can programmatically deiconify a Frame? Basically, I have a window that needs to be deiconified after being notified of the completion of a task. I have written a program in IBM Visual Age 3.0, which uses JDK1.1.7A, JFC1.0.3. Calling setVisible(true) after either: setBounds(with the old), or setLocation() causes the window to be restored to its old ...

12. Frame    coderanch.com

hi, it is obvious isn't it. u r setting the size of the frame only after the return from the constructor. so the size of the frame will be 0,0 in the constructor. only after it returns from the constructor will be size be set at 800,300.after the command setSize in the main method. Rahul [This message has been edited by ...

14. Frame Trouble    coderanch.com

Unfortunatly, you have to write the code to close the window yourself(sort of). I believe that it generates an event when you click on the close button, but you then have to capture it and destroy the window. Not exactly sure how, but one way would be to setVisible(false) and then set the frame equal to null. There may be a ...

15. Frame    coderanch.com

16. Frame question    coderanch.com





17. A question for my frame    coderanch.com

18. A question for my frame    coderanch.com

I know of no way to remove this warning label. It is there for a purpose, and should not be removed. Applet windows must have this warning so that end users can distinguish who is popping up this window that is asking them for their password. If you visit a secure website that is running WinNT, a dialog box will come ...

19. Frames, frames, frames....    coderanch.com

20. adding a table to a frame    coderanch.com

21. Tabulation Order in a frame    coderanch.com

23. LOV in a java Frame    coderanch.com

24. Frames    coderanch.com

Two things: 1) Your name violates the naming standards that you agreed to when you registered. Please change your display name to be your real first name - space - your real last name. 2) Don't you think this would be better asked in the Swing/AWT forum? I am moving this there.

25. detecting if a Frame is resized    coderanch.com

Hey dirk.. i don't know about that. But anyway I came up with some code that may be helpfull. Heres what to do.. run the code. A small JFrame will appear. Drag the mouse around in it. TNotice the frame says "NOT RESIZED". Now resize the frame and move the mouse around " A differnt message shows. However it works only ...

26. how to set pos of a frame    coderanch.com

27. getInsets() and Frames    coderanch.com

Has anyone else had a problem getting correct values for border sizes when using getInsets() inside Frames? I have a Frame to which I am adding a container, but despite my use of getInsets().top (etc.) the component is still partially obscured when the Frame is shown. I have the following code to try to set the Frame to its correct size: ...

28. Frame    coderanch.com

If you imagined your screen being divisible into 4 quadrants; I am trying to write a program that does the following. By implementing the ActionListener interface and the Timer class, every 3 seconds fill one quadrant with the JFrame I created. Any idea on how I can get the frame to pop up in each quadrant? // Begin Code import java.awt.geom.*; ...

29. Frames    coderanch.com

30. How to use AWT's Frame()???    coderanch.com

... import java.awt.*; ... if (thisEmpRec.picture != null ) { int wotsInIt = (thisEmpRec.picture).length; System.out.println("=>demoApplet : picture size is " + wotsInIt); thisEmpPic = new ImageIcon(thisEmpRec.picture).getImage(); // repaint(); Frame frame = new Frame(thisCliPic); frame.setSize(300, 275); frame.show(); // frame.setVisible(true); } }// end of if-then-else }// end of if-then-else }//end of actionPerformed()-method // // --------------- painting image // public void paint(Graphics grph) { ...

31. how to create two frames with two different applications running in awt    coderanch.com

Hi, I like to know how to create two frames with two separate applications like Internet explorer and note pad running simultaneously using awt. i also want to know how to attach the application like internet explorer browser in the frame in awt. i am having an hard time in figuring it out. any help appreciated Thanks Regards Chandhrasekar Saravanan

32. Frame.setExtendedState() causes bounds to be reset?    coderanch.com

I'm using Windows 2000 and JDK 1.4.1. I've got a simple Frame that I'd like to make behave properly in between application invocations. For example, when the application exits, I save its bounds and extendedState in my Preferences tree. I'm running into trouble with maximization. If, during startup, I do the following: 1. frame.pack(); // realize the frame 2. frame.setBounds(boundsFromPreferences); 3. ...

33. How do I get Frame?    coderanch.com

Well, it might be reasonable, depending how severe the error is. Exiting the application should be a last resort. If there's anything you can do to recover from the error, that is a better way to go. To find the frame or dialog a component is in: JComponent.getTopLevelAncestor() will do the job.

34. how to write info to Frame's status    coderanch.com

35. Frame no response    coderanch.com

hi all, I put a panel into the center of a frame, and there is a drawing diagram inside the panel, also put some buttons into the west of the frame. But some times the whole frame beacomes "GRAY", can't see anything, even can't see those buttons, why??? anybody can give some some ideas? thanks in advance dejie

37. Split a frame    coderanch.com

38. how can i make a fancy Frame    coderanch.com

Hello!!! I want to make My Application Frames Fancy not like this quire type of Frame. i want to make it like as rounded or like VIEWSonic software shape... and i also want to add backgound Picture on Frame. Note: i dont want to use skins. Is it possible??? Kindly help me Thanx in advance

39. Frames    coderanch.com

I have a main screen (Main.java) which opens up Frame1.java when you click the OK button. The code I am using in the actionListener is if(e.getSource() == OK) { new Frame1(); } However, when I close Frame1, I would want to go back to the Main screen (Main.java). At the moment it closes both Frames when I close Frame1.java.

40. navigation between frames    coderanch.com

41. getting rid of ContentPane/frame    coderanch.com

42. Frame being hiden on JFileChooserOpen    coderanch.com

43. Frame Attack!    coderanch.com

i wrote a quiz once. i stored the questions and answers in a file. it is an applet that talks with a servlet, but the code might help you. import java.awt.*; import java.awt.event.*; import java.applet.*; import java.io.*; import java.net.*; import java.util.*; public class Quiz extends Applet implements ActionListener { private int total = 10000; private boolean correct; private String correctAnswer; private ...

44. To many Frames    coderanch.com

Do you really have to do this with a new class/frame for each question? If not, see if this makes sense. import javax.swing.*; import java.awt.*; import java.awt.event.*; class Quiz extends JFrame implements ItemListener,ActionListener { int marker = 0; JRadioButton[] rb = new JRadioButton[5]; int rbLen = rb.length-1; ButtonGroup group; Button b1,b2; JLabel jl; String[] question = {"Who played the guitar solo ...

45. Connecting Frames    coderanch.com

How would you connect two frames in a program. For Example, lets say I have a frame that has a button on it, when I click that button it would go to another frame that would have a label on it. I am using AWT but Swing code would also be appreciated. Thanks in advance!

46. Frames    coderanch.com

47. Trasparent frame    coderanch.com

48. Frame question    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class FrameTest { static JFrame frame; static int frameCount = 0; public static void main(String[] args) { JButton launch = new JButton("launch frame"); launch.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { launchFrame(); } }); JPanel north = new JPanel(); north.add(launch); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(north, "North"); f.setSize(300,200); f.setLocation(200,200); f.setVisible(true); } private static ...

49. get all Frames created by the application    coderanch.com

The problem with getFrames(), it can affect the appearance of my desktop components (ex. I run my apps then try to click my Windows Start button, popup window is keep on flickering and the tooltip as well). May be there is something loop/thread inside in this method. How can I get rid of this?

50. removing bottomline from frame, how-to?    coderanch.com

51. many new frames    coderanch.com

So i have a DefaultListModel and when i have a new socket connection to teh server ,some information about the client is added to the List model. After that wont when i click twise over one of the objec to open a new frame application(chat console) if(e.getClickCount() == 2){ int index = list.locationToIndex(e.getPoint()); Client client = (Client) StoringData.vector.get(index); try { ...

52. frame properties    coderanch.com

53. Getting data from one frame into another    coderanch.com

Developers I am having a frame say frame1 which is having a button and textfield. On clicking a button which is on that frame1 I am displaying a frame say frame2. Inside that frame2 I am having a text field and a button. What I want is that when I will click on button of frame2 whatever there in the textfield ...

54. How to show Modelless Frame    coderanch.com

55. Completely delete a frame without deleting the application    coderanch.com

I have two frames, GUI gui and GUI2 gui2. I can invoke the dispose method to delete gui2 by clicking a button on gui. But when I click the Start button on gui to create a new instance of gui2, gui2 still displays the animation before deletion. This is because: dispose public void dispose() The Window and its subcomponents can be ...

57. empty application frame    coderanch.com

58. 2 frames!!!    coderanch.com

i have 2 frames in my application on for options and the other is the main frame ....i want to have the main frame visible when i use the options frame but at the same time i dont want it to be focusable as longas the options frame is opened ...i tried the mainframe.setFocusable(false)...but it didnt work ... i want the ...

59. Question about empty frame    coderanch.com

I use swing JFrame now,and want to activate another Frame after press the button on the original one, but my program ran very wield, that my new frame showed up but I can not see anything on it. But if I move the size of the frame, then everything on the frame showed up. could any of you guys can figure ...

60. what is a Frame??    coderanch.com

61. GUI Inner Frame    coderanch.com

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ...

62. frames    coderanch.com

By default, closing a Frame just gets rid of that one Frame, and the program keeps running. This is a good default in an application where they may be multiple Frames. But in an application where there will only ever be one Frame, it makes sense to exit the JVM altogether (i.e., quit the program) when the Frame is closed. That's ...

63. transperant frame    coderanch.com

64. Cannot create a second frame.    coderanch.com

65. JLogin Frame -> Third party code???    coderanch.com

66. Frames    coderanch.com

67. set pixel in frame    coderanch.com

68. Structure of Multi-frame Swing App    coderanch.com

Apologies if this is a very basic question. I am new to Swing and am having a some difficulty. I am trying to write a little application which is basically one Frame with a menu bar. When a user clicks on a menu option, I need to open another frame and get them to change some stuff. I dont know how ...

69. Put A Frame In A Shell?    coderanch.com

Hi, Hopefully this is a simple question with an equally simpler answer... I have an application, built using Swing, and AWT (ie, no SWT). I've had one tiny problem, which is the application icon in the title bar, which doesn't display properly using a Frame or JFrame - it only takes one image, so doesn't scale properly when it needs to. ...

70. Adding drawpanels to a frame    coderanch.com

71. Frames    coderanch.com

72. using the same frame for another class    coderanch.com

need help in making my codes work together.i have two classes,i want it in such a way that when i click on the next button it takes me to the next page.but anytime i click on next button it brings up the page in a frame on top the other frame.please what i do to achieve my aim.

73. Frames    coderanch.com

I am using FRAMES.oracle as backend.I want to get output from the datbase which i thought to get it on a TextArea. but i thought of getting someother solution for that as the output is not the way i want...i mean "formatted". I thought of using JTable but it looks as if it can only be used for download manager i ...

74. Q: how to put a JPEG to the north region (of the frame's contentPane)    coderanch.com

unless you plan to do something else with LogoPanel, you don't need it. change frame.getContentPane().add(BorderLayout.NORTH, logo); to frame.getContentPane().add(BorderLayout.NORTH, new JLabel(new ImageIcon("logo.jpg"),JLabel.LEFT)); assumes you want the logo on the left (from drawImage(0,0)). If not, modify JLabel.LEFT, to suit [EDIT] just reread your post, and see you are experimenting, so I haven't actually answered your query. when you put something in BorderLayout.NORTH (or ...

75. Multipe Frames to front    coderanch.com

Hi, I have got three frames. If I activate frame 1 I want to also bring frame 2 + 3 to front, but must stay to frame 1. I tried. public void windowActivated(WindowEvent e) { frame2.toFront(); frame3.toFront(); frame1.requestFocus(); } This brings all frames to the front, but the focus remains at frame3. I also tried: public void windowActivated(WindowEvent e) { frame2.toFront(); ...

76. frame.setMenuBar(mb);    coderanch.com

77. Own Frame    coderanch.com

78. Issues in creation of 2 tables in 2 different frames in the same Page using JClass    coderanch.com

Hi, Usage: JClass Pagelayout I am trying to create 2 tables in 2 different frames in the same page using JCtable,JCFrame. There is some or other issue popping up while coding for insertion of the tables in the frames. If the records are more than 100, they are displayed in the same page in the 2nd frame instead of going to ...

79. frame minimization    coderanch.com

80. Haw to separate a frame to diferent fraims    coderanch.com

import javax.swing.*; import java.awt.*; import javax.swing.border.*; import java.awt.Color.*; class SplitPane { SplitPane() { JSplitPane sp = new JSplitPane(); sp.setOneTouchExpandable(false); sp.setDividerLocation(50); JPanel panel_left = new JPanel(); sp.setLeftComponent(panel_left); JPanel panel_right = new JPanel(new BorderLayout()); JPanel panel_r_up = new JPanel(); panel_r_up.setBorder(BorderFactory.createLineBorder(Color.black)); panel_right.add(panel_r_up,BorderLayout.PAGE_START); panel_right.add(new JSeparator()); JPanel panel_r_dawn = new JPanel(); panel_right.add(panel_r_dawn,BorderLayout.PAGE_END); sp.setRightComponent(panel_right); JFrame frame = new JFrame(); frame.add(sp); frame.setSize(200,200); frame.setVisible(true); } public static void main(String ...

81. Two frames in one application?    coderanch.com

82. Creating Progress Monitor As Independent Frame    coderanch.com

Hi: Im trying to implement a Jframe that pops up when I run my program. The variable "date" is a double and is given to the following code locally. I can get the Jframe to open up...but the progress bar won't appear. I want the frame to stay open so long as the run has not been completed. Upon completion I ...

83. about centering of the frame and using the new frame    coderanch.com

first I set choices then if any of that choices been selected a new frame will appear, but my problem is i want to use the button of that new frame but i cant click. i know it is because i use do while in there but i put it there because when i close the new frame the choices will ...

84. Help with adding a frame to netbeans    coderanch.com

85. Swing substance not 'skinning' entire frame.    coderanch.com

Hi guys, I have just started looking at developing a Swing app and found the 'substance' JAR and how it can change the LAF of an application. I have found a couple of sample app and coied their way of working, but whilst the sample apps appear to have then entire app skinned (titlebar, border etc) for me I only get ...

86. traversing between frames    coderanch.com

What do you mean by "travserse between the frames" as this is kind of fuzzy to me? What precisely are you trying to do? Some suggestions: 1) simplify the problem as much as possible so that you don't have to worry about extra code getting in your way, and so if you post your code, we don't have to plow through ...

87. Frame    coderanch.com

89. Redirecting of one frame to another frame    coderanch.com

What does mean "to redirect a frame" ? Maybe then this is "redirecting a JPanel", not "a frame"? import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class Test { JFrame frame; JPanel one, two; Test(){ frame = new JFrame(); one = new JPanel(); JLabel l1 = new JLabel("one"); JButton b1 = new JButton("hop to two"); b1.addActionListener( new ActionListener() { @Override public void ...

90. frame navigation    coderanch.com

91. Frame work for RBAC implementation in Swing    coderanch.com

Hi, I need to implement role based access control to a swing framework application. I was looking to find some standard implementation patterns if existent so that i could check if it's possible to implement them in this application. Is there any work already going on to provide RBAC with swing / AWT ? Currently my need is limited to have ...

92. closeable frame    coderanch.com

EXIT_ON_CLOSE and System.exit(0) can be hazardous if there is anything else going on, for example writing to a file in a different thread. That might terminate the other thread, too, leaving the file incomplete or corrupt. Dispose would be better; the JVM will continue to run until the file writing is completed and the other thread terminates.

93. A frame not showing up    coderanch.com

Hi I have recently written an application that uses two JFrames. I post this in the "Java in General" because I don't know what kind of issue this is? The program runs perfectly when i start it from cmd, but when i pack a .jar file and run that, it only shows one of the two JFrames?? The code that contains ...

94. How to use custom class in frame    coderanch.com

Hi Guys, I was trying to write all button in one java class which extends component and use that object in my main class, But its not displaying those buttons. I have to use AWT and not swings. Please help import java.awt.*; public class ButtonMenu extends Component{ Panel p = new Panel(); Button general, drawTools, modules, advance, themes; public ButtonMenu(){ p.setLayout(new ...

95. How to build a frame ?    coderanch.com

Hi so i wrote this program KeyboardReader reader = new KeyboardReader(); double a; double b; double c; double d; double e; System.out.print("grams "); b = reader.readDouble(); System.out.print("Molar Mass: "); c = reader.readDouble(); System.out.print("Molar Mass2 : "); d = reader.readDouble(); a = b * (1 / c); e = a * d; System.out.print("Grams = "); System.out.println(e); reader.pause(); So i am wondering how ...

96. navigation b/w frames    java-forums.org

97. Help regarding Frames    java-forums.org

Hey guys, This s my problem. Lets assume we've two frames. First one has three text fields and a button. second frame has three labels which initially has no text. now when the program is run only the first frame should be displayed and after entering values in that text field and clicking the button,the second frame should get displayed with ...

98. User input for frame    java-forums.org

Hello, I would like to know if it's possible to do the following. I want to take two JTextFields, and a JButton. One of the TextFields will take a number from 1-5 for an amount of rows, and the other will do the same for amount of columns. Then after the information is accepted and the button is clicked, the frame ...

99. how can i move from Frame to another    java-forums.org

100. How to get the smtp response to the gui frame    java-forums.org

hey sorry about the title. Iam new to java and so i have a problem in doing this assignment actually i created a gui which has fileds like to,from,cc,bcc,message area,response area and few buttons like send,restartand connect connect button the response is comming my problem is now when i send the information to the server i.e smtp server the response must ...