JFrame 2 « JFrame « Java Swing Q&A





1. Support for JFRAME    coderanch.com

Hi all, I've created a JFrame applet and it is downloading from server and calling the applet from browser. I have installed swingall.jar in server and started the application. It is not getting displayed in the client browser. Now i have installed the same "swingall.jar" file in the client side and set a classpath. After doing this it is getting perfectly. ...

2. access at a JFrame in an other class    coderanch.com

3. why JFrame is heavy?    coderanch.com

4. How to make a Jframe from minimum to maximum ?    coderanch.com

My environment is win2000+java1.2 Now I have build two Swing Jframe : frame1 and frame2. The frame1 is current shown in the screen . The other Jframe , frame2, is minimized . I want to when I click a button in the frame1, the frame2 can maximize and be shown in the current screen . But I dont know how to ...

5. JFrame    coderanch.com

Many thanks for replying me! That was very helpful. I saw a sample code in the thread you indicated. I'm really surprised seeing the forum is so active. In the singleton pattern program, if the second window is minimized, it is not coming back again when button is clicked. Is there a way to bring the second window back ? Once ...

6. JFrame    coderanch.com

8. JFrame    coderanch.com

9. About JFrames    coderanch.com





10. gettin printout of a jframe    coderanch.com

11. Tying two JFrames together    coderanch.com

12. JFrame    coderanch.com

13. Help!!!!!How to add hotkeys into JFrame    coderanch.com

14. JFRAME STAY IN FRONT    coderanch.com

15. JFrames    coderanch.com

public class ShakeJFrame extends javax.swing.JFrame { private static void pause() { try { Thread.sleep( 100 ); } catch ( Exception e ) { } } public static void main( String[] args ) { ShakeJFrame program = new ShakeJFrame() ; program.setSize( 200 , 200 ); program.setVisible( true ); for ( int i = 0 ; i < 100 ; i++ ) { ...

16. Won't build a Jframe    coderanch.com

Sorry, I did see her post and tried that approach. i will post the whole class, I just posted the part it was executing through before. When I run it gets to the point where it prints out "Creating a Frame" then quits. package divelog; import javax.swing.*; import javax.swing.JFrame; import java.awt.*; import java.awt.event.*; public class DiveLog { //Opens DiveLog class private ...





18. Customized Swing JFrame    coderanch.com

19. copying JFrame into Clipboard - urgent    coderanch.com

20. how to Deiconified the JFrame????    coderanch.com

Hi, I have 2 JFrames, let's say frame1, frame2 in frame1, i have deiconifiedButton("Deiconified frame2"), so in actionPerformed of deiconifiedButton, how do i deiconified the frame2 when frame2 is in iconify state? I call frame2.show(); but it doesn't work. I wonder is it because of the platform or something? i try the frame2.requestFocus(); doesn't work either! Plz help me out! Thanks ...

21. Difference between Frame and JFrame    coderanch.com

Heavyweight means each Java component has a native peer associated with it. A native peer is an OS-specific component... AWT is heavyweight, so if you create a AWT Button, on the Windows platform an MFC button is created, on *nix a Motif button is created, etc. Lightweight means that there is not a native peer associated with the java component. This ...

22. Center jFrame    coderanch.com

23. dimming JFrame    coderanch.com

24. JFrame    coderanch.com

Hi Ranchers, I am developing a very simple application which has 6 Frames. MainFrame is the main screen and has 5 Buttons which link to the other 5 Frames.When I click Button1, it opens Frame1, button2 opens Frame2 e.t.c. I am using the following code to open the Frames. if(e.getSource() == button1) { new Frame1(); } Frame1 opens but when I ...

25. Minimise restoring JFrame    coderanch.com

if (System.getProperty("java.version", "1.1").compareTo("1.2")>=0) { Debug("UnPop Desktop java.version > 1.2"); try { int iIconified=0; int iNormal=0; Class cl=Frame.class; Field field; Method meth; Object args[]; Class parameters[]; Object oResult; field=cl.getDeclaredField("NORMAL"); iNormal=field.getInt(this); field=cl.getDeclaredField("ICONIFIED"); iIconified=field.getInt(this); parameters=new Class[0]; meth=cl.getDeclaredMethod("getState", parameters); args=new Object[0]; oResult=meth.invoke(this, args); Debug("UnPop - try to minimise"); if (((Integer)oResult).intValue()==iNormal) { parameters=new Class[1]; parameters[0]=int.class; meth=cl.getDeclaredMethod("setState", parameters); args=new Object[1]; args[0]=new Integer (iIconified); Debug("UnPop: Minimise"); meth.invoke(this, args); ...

26. JFrames    coderanch.com

27. JFrame decorations aren't working    coderanch.com

I'm trying to switch between UIs at run time. I switch the Look and Feel, and tell the system to update but for some (Windows, Motif, and a few downloaded UIs) the window decorations refuse to come up. Obviously, they don't have decorations, so is there a way to dynamically switch between the decorations in a UI and the decorations specified ...

28. How do i know if a JFrame is iconified?    coderanch.com

Hi there! could someone please tell me how I can check if my JFrame is either fully iconified or fully maximised or in full display. The reason I ask this is because when I run my test program on a MacOS X (10.3.2 JKD 1.4.2)platform, minising and maximising, the program hangs. I think it is something to do with me trying ...

29. JFrame application HELP Needed ! ! ! (STILL NEED HELP)    coderanch.com

Ranch Hands: There is a lot of code here. Do not let it throw you. Most of it is here to avoid having to repost it if someone has a question The problem lies within the statement followed by this comment (I think) // # # # PROBLEM # # # in class MYFrame. All code compiles clean. OBJECT: Illustrate inheritance ...

30. Help with JFrames    coderanch.com

Can anyone help me? I want the first piece of code (the JTextArea and Jbutton) to replace the Jbutton in the second piece of code. I am not having any luck in getting this to work. Thank you in advance import javax.swing.JFrame; import javax.swing.JTextArea; import java.awt.BorderLayout; import java.awt.Container; import javax.swing.JButton; public class Instructions { private static JTextArea jTextArea; public static void ...

31. JFrame    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class LaunchingAJFrame extends JApplet { public void init() { JButton launch = new JButton("launch frame"); launch.addActionListener(new ActionListener() { int frameCount = 0, dx = 75, dy = 75; public void actionPerformed(ActionEvent e) { final JFrame f = new JFrame("frame " + ++frameCount); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { f.dispose(); } }); f.setSize(200,100); ...

32. JFrame    coderanch.com

Thanks, Eddie, thats what I did. However, the problem is that when the shape gets drawn outside of the viewing window (which means it's not or only partially visible) then I want to have scroll bars available for the user to scroll. How do I do that?? I have the scrollbars, but somehow, they stay disabled... thanks, Ben

33. JFrame...    coderanch.com

34. round rectangle swing JFrame    coderanch.com

35. Useless JFrame Clearing    coderanch.com

If I create a JFrame and then drag a component over it, it constantly clears the "damaged" area of the JFrame with its background color before repainting. To make the behavior more noticeable as I was trying to alleviate it, I set the background color to red. Repainted areas became VERY evident, especially when dragging windows from other apps over the ...

36. Customising JToolTip / using JFrame?    coderanch.com

Hi I have a Java Application and I want to create a tooltip similar to what you see on some windows applications when you click on a link. It looks like a tooltip but the box doesn't go away until you click on an area outside it or if you press the x button in the top right corner. Can someone ...

37. JFrame Question    coderanch.com

38. Simple JFrame formatting...    coderanch.com

39. trapdoor to add'l functions to JFrame?    coderanch.com

I want my GUI to have a set of button that are invisible to the regular user, but that "super users" can type in F2, 9, ctrl-page up, F10 (some random sequence of key strokes) to make appear additional buttons. I guess I want a trapdoor, like in video games where you have to do up-up-left-up-right to get some cool upgrade. ...

40. JFrame visibility    coderanch.com

41. Getting JOprionPane to appear within the confines of JFrame    coderanch.com

Ive written medium sized program with a sizeable GUI and am having problems scoping my JOptionPanes to appear in the confines of my main JFrame. This has become a big problem for me and i have tried lots of things to solve it but nothing has worked. The Dialogs that im having trouble with all reside in actionListeners and then some ...

42. Printout of JFrame    coderanch.com

43. Probelm with JFrame Minimization.    coderanch.com

Hello Sir, My Project is Continues Server Monitoring System. I have created JFrame for ADD, EDIT, anf DELETE which will be visible clicking on those button. My problem is that while user click on ADD button then frame should be visible and stay until user want to Minimize or Close it. But my frame is generating and Minimizing automatically. This happens ...

44. toolbars in JFrame    coderanch.com

46. JFrame question.    coderanch.com

47. Reclaiming resources from a JFrame    coderanch.com

I'd like to reclaim the resources from a splash screen that is programmatically opened and closed in the constructor of the main frame while the components are instantiated for the main frame. Is it appropriate to call .dispose() on the splash frame after the .setVisible(false) method in order to reclaim the resources from this frame or does it lose scope once ...

48. JFrame    coderanch.com

49. non iconifiable JFrame    coderanch.com

50. JFrame Greying Out    coderanch.com

you want them all disabled? you can start at the top level container and recursively call container.getComponents(), and disable them, but I'm trying to work out the purpose of this - if it is to stop access to the components, all you'd have to do is set the dialog's modal property to true

51. class JFrame    coderanch.com

> I post questions for the benefit of learning. I know the answer to the > question already. My goal is to solicit an intelligent conversation with > people in this forum. Please, think about the question before you put me > > in a box and direct me to the api. Funny, I don't recall your original post indicating that ...

52. Jframes    coderanch.com

53. Area of a JFrame    coderanch.com

54. Fancy JFrame?    coderanch.com

55. JFrame    coderanch.com

56. JFrame    coderanch.com

57. Grabbing pixel on JFrame    coderanch.com

58. Stretchy JFrames    coderanch.com

59. Run non-Java program inside a JFrame    coderanch.com

60. Show .xls in JFrame    coderanch.com

61. help with JFrame program    coderanch.com

Hi..i have posted this problem before but i didnt get an appropriate answer..maybe i didnt explain it well enough. i have to implement a draw method that MUST have this signature: draw(Point p1, Point p2, Point p3, int n, JFrame, w). I came up with this code: import javax.swing.*; import java.awt.*; /******************************************************************************* * recursive triangles ******************************************************************************/ public class Triangle { Point ...

62. Check the JFrame is opened already or not    coderanch.com

Dear Ranchers, I'm doing a project in Java Swings and MySQL. I'm using Menus for the project. In the first menu, When the action is occured it is opening a new window. I'm using the new child window "always on top". But when i tried to open it again, it is opening. Can i do a if condition to check whether ...

63. JFrame confusion    coderanch.com

There are different ways of doing this. Here's one possibility. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ObjectClass1 implements ActionListener { JFrame f; // Member variables have class scope. JLabel label; ObjectClass2 oc2; public ObjectClass1(JFrame f) { // To avoid problems with static variables/context // we can pass the JFrame reference f into this class // via a constructor like ...

64. Transfering data between two JFrames    coderanch.com

Allright, I have a project going on which require me to move some data between different JFrames (which are also different classes). What I want to do in particular is take an Object which I've created in one window and move all that information on to the next window. I've asked this question on other boards with no valid answers. So ...

65. Communicate between JFrames    coderanch.com

66. Funny JFrame behaviour    coderanch.com

Hi everybody! I wrote some code overwriting JPanel's paintComponent() method and put it in a convenience JFrame. package toyz.lotto.gui; import gui.containers.BasicWindowMonitor; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.GridBagConstraints; import java.awt.geom.Rectangle2D; import javax.swing.JPanel; /** * * @author vfriedmann */ public class ScalableLottoPanelImage extends JPanel { public static void main (String[] args) { ScalableLottoPanelImage lottoimage = new ScalableLottoPanelImage(); GridBagConstraints gbc = new ...

67. JFrame Crash?    coderanch.com

Hi Everybody, Here we have a typical GUI application that uses mainFrame.pack method to initialize main window. The odd thing is that it runs ok but sometimes after a normal exit and again startup, the system hangs with no erro or obvious reason. We traced it and it showed up that it is stopped at this method! Any comment?

68. JFrames    coderanch.com

69. JFrame    coderanch.com

70. Vertical gray patch in my JFrame?    coderanch.com

Hi, I've learned Java, but that was two years ago... Now I'm back to it and I've reached Swing components. I have a small problem here. I wrote some programs, which are working fine, except for one vertical gray patch at the right side of the frame/panel. I think it's something probably really small, but I can't figure it out since ...

71. JFrame    coderanch.com

The best way to get this understanding on your own (because you surely will have more questions as you study more), is to refer to the API. If you look up JFrame.getContentPane on the API, you'll see that it returns a Container. If you hypertext link over to Container, you'll see that it has an add method. Using the API is ...

72. Question regarding JFrame in Java    coderanch.com

public class GuiWindow{ private Guizilla guizilla; private static StyledDocument page; private static JTextField addressLine; private static JTextPane pageText; private JFrame frame; public GuiWindow(Guizilla parentGuizilla) { guizilla = parentGuizilla; frame = new JFrame("Guizilla"); frame.setPreferredSize(new Dimension(800, 700)); addressLine = new JTextField("Guizilla:home"); pageText = new JTextPane(); pageText.setBorder(BorderFactory.createBevelBorder(1)); pageText.setEditable(false); pageText.setSelectedTextColor(Color.BLUE); page = pageText.getStyledDocument(); JButton backbutton = new JButton("Back"); JButton sendbutton = new JButton("Send"); JLabel link1 ...

73. Doubt on JFrame    coderanch.com

74. JFrame into another JFrame    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. - ...

75. JFrame Help Please    coderanch.com

Hey all, Basically i havn't programmed for quite a while now and am trying to get back into it, i am trying to make a little application with a JFrame, and here is the code I have produced... public class titleScreen extends JFrame { ImageIcon title = new ImageIcon("pics/title.JPEG"); JLabel label1 = new JLabel("The Software For Your Garden", title, JLabel.CENTER); JLabel ...

76. Center a JFrame ...    coderanch.com

77. How to add Date Picker in JFrame    coderanch.com

78. JFrames    coderanch.com

JMF also has some support for user interfaces. javax.media.Player has methods getControlPanelComponent and getVisualComponent for controlling and showing media files. I've been able to play a small movie in Java this way. I do think that these controls are heavyweight controls, so mixing it with Swing (lightweight controls) may lead to some unexpected results.

79. Swing JFrame    coderanch.com

I assume that you've gone through the Sun tutorial on how to use internal frames? If so, it should have laid it all out for you. A better question here then may be "what specifically in the tutorial did you not understand?" I also second the recommendation above that you post your current code and explain how it's not working. If ...

80. Question on JFrame    coderanch.com

81. JFrame usage    coderanch.com

Dear Ranchers, Just want to know if it is possible to have JFrame or any component to cover the entire computer page including the taskbar. What I am looking for is an application that looks like a screensaver but not necessarily screensaver, that will require password input to get deactivated. Or rather any sort of component that will freeze all action ...

82. JFrame    coderanch.com

83. JFrame    coderanch.com

Many thanks for replying me! That was very helpful. I saw a sample code in the thread you indicated. I'm really surprised seeing the forum is so active. In the singleton pattern program, if the second window is minimized, it is not coming back again when button is clicked. Is there a way to bring the second window back ? Once ...

84. how do I reset the JFrame?    coderanch.com

I need to draw a series of lines and then clear the screen and begin drawing again. Can anyone have a look at my code an offer any suggestions? import java.awt.*; import java.awt.event.*; import java.awt.Graphics; import javax.swing.*; public class screenSaverSim extends JFrame implements ActionListener { int counter = 0; protected Timer timer; public screenSaverSim() { super("my screen saver"); timer = new ...

85. Double buffered JFrame    coderanch.com

86. can we have audio clips in JFrame?    coderanch.com

87. JFrames    coderanch.com

88. How to make JFrame NON-Resizeable?    coderanch.com

89. Trouble with Jframe.setUndecoratble    coderanch.com

90. Help for JFrame    coderanch.com

hi all I have Created one Frame and in which Buttons are provided which opens new Internal Frames....what i want is when i open one Internal Frame the other Internal Frame gets closed... or if i click one button then other button gets disabled and when i close the internal frame all disabled button gets enabled... please help me out.... thank ...

91. Two JFrames...    coderanch.com

92. Adding java programs into JFrame    coderanch.com

Hi, I need some help getting my last assignment finish and I am having a hard time finding help with this one. The goal of this last assignment is to take 6 program examples the professor has provided and put them into one top level container. I need some assistance being pointed into the right direction with this one. Thanks

93. override paintComponent in JFrame    coderanch.com

94. Adding an Executable to JFrame    coderanch.com

Cynical answer. "Teacher told me to create a calculator in Swing. Windows already has one so I'll avoid the work by putting it in my JFrame". Short answer to your question is you can't. I'm sure there is some long winded way, as Pete suggested, to do this, but this is beyond the basic design and premise of Java and Swing. ...

95. How do I make things in my JFrame?    coderanch.com

96. number of Jframes per application    coderanch.com

97. Using JFrame in Web App that runs on iSeries    coderanch.com

A few things. 1. Your app server is probably not running an X-Windows subsystem so you can't do GUI stuff on it. 2. That isn't how you deliver Swing to the client anyway, so you don't have to worry about it. You have two options when it comes to delivering Swing to client machines. Applets or JavaWebStart. Applets embed Swing into ...

98. Creating and showing JFrame from another JFrame    coderanch.com

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MainFrame { private static final Dimension MAIN_SIZE = new Dimension(400, 300); private JPanel mainPanel = new JPanel(); private DialogPane dialogPane = new DialogPane(); public MainFrame() { JButton showDialogBtn = new JButton("Show Dialog"); showDialogBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(mainPanel); JDialog dialog = new JDialog(frame, "Dialog", true); dialog.getContentPane().add(dialogPane.getComponent()); ...

99. Getting All The componts in a JFrame    coderanch.com

Hi, This is my code class MyFrame extends JFrame{ MyFrame (){ // some code goes here Component[] components1=getContentPane().getComponents(); for(int i=0;i

100. JFrame?    coderanch.com