JFrame 4 « JFrame « Java Swing Q&A





1. JFrame possition    forums.oracle.com

Check out the documentation for setLocation, setLocationByPlatform and setLocationRelativeTo. I am only new to Java, but got this information quite simply from the popup Help in NetBeans. A useful one is setLocationRelativeTo(null), which positions the window in the centre of the screen, if you want that. To position at a particular point on the screen you can use setLocation(Point p) or ...

2. Default JFrame opeartions    forums.oracle.com

3. Help with JFrame    forums.oracle.com

4. 2 JFrames, 1 Class    forums.oracle.com

6. JFrame Issue    forums.oracle.com

7. How to create Jframe?    forums.oracle.com

8. JFrame    forums.oracle.com

This is GuiTesting import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JButton; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; class GuiTesting extends JFrame { private static final int width = 500; private static final int height = 175; private JLabel nameLabel, addressLabel, phoneLabel; private JTextField nameTextField, addressTextField, phoneTextField; private JButton okButton, clearButton; private OkButtonHandler obHandler; //private ClearButtonHandler cbHandler; public GuiTesting() { ...

9. 2 simple question using package and using JFrame    forums.oracle.com

1.In eclipse how do i use the package? i am trying to add "import il.ac.intprog.shapes."(my package) but it wont compile,do i need to set some path? 2.I am drawing the shapes inside a JFrame,and i would like that the file will be loaded only after the frame is ready,is there any event which i can use Thanks in advance.





10. jframe question please help    forums.oracle.com

11. Need help with AWT JFRAME    forums.oracle.com

12. Netbean - can java class put inside JFrame form?    forums.oracle.com

I've created a java class. Inside, i do all my coding, and dindt use the GUI from netbean, then now i wanted to add the java class i type into a netbean GUI JFrame form. How do i do it? I cant link them no matter what... Can i link them actually??

13. NetBean - java class add to JFrame form?    forums.oracle.com

i have already type my own class using 'java class type' . The problem is, now i wanted to add a new class using the GUI in netbeans, so i create a JFrame using GUI in netbean, how do i connect the 'java class type' with the 'JFrame Form type' in netbean? I'll be able to call a frame to another ...

14. Noob Doubt : Linking one JFrame Form to another    forums.oracle.com

I'm using NetBeans IDE 6.8 to create a simple app. I created a package SimpleGui and in the Package created 2 JFrame Forms. The 1st JFrame form contains a Button "login". When i press the button i want the 2nd JFrame form-NewPage to appear and do its thing. What should i type in the loginActionPerformed method of the 1st JFrame Form ...

15. Proper way to use my class in a JFrame app    forums.oracle.com

You generally instantiate a GUI by calling the constructor from the main method and then have the constructor parcel out the actual work to other methods, like: createGUI, buildButtons, whatever. For a trivial (no insult intended, more like simple or learning) example, just build the entire GUI in the contructor - though now I say that, the IDE will probably build ...

16. jframe related    forums.oracle.com





17. JFrame Question...    forums.oracle.com

Hi, Just a quick question. I dont' know if the answer will be as quick..because i didn't find anything that explained this.... anyway... Does anyone know how to put the windows taskbar on top of the JFrame? I'm asking this because i used MAXIMIZED_BOTH on my JFame and I don't want to hide the taskbar where all the minimized windows go.... ...

18. JFrames    forums.oracle.com

You would benefit by going through the Sun Swing tutorials before trying to create this stuff as your code is wrong in many many ways. You will probably want to just scrap this code and start afresh after going through the tutorials. Also, what's with all the static variables, methods, and whatnot? edit: I've tried to go through your code again, ...

19. JFrames    forums.oracle.com

/** * Normal Constructor * @param w width * @param h height * @param n mainname * @param f frame */ public MainFrame(int w, int h, String n, JFrame f) { width = w; height = h; mainname = n; frame = f; JFrame frame = new JFrame(mainname); frame.setUndecorated(false); //use this for undecoration frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(width, height); frame.setVisible(true); }

20. making a JFrame stop running when the x push is pushed    forums.oracle.com

is it defaul for a program to end when the JFrame's x is pushed? because i use netbeans and when i run it and then i close it using the x in the corner it still shows that it is running in the bottom right corner and i have to stop it in the netbeans IDE, i was just wondering if ...

21. Java Chat Room, creating new JFrame?    forums.oracle.com

Hi there, My project involves me editing some java code that tells everyone who logs into the chat room what users are currently in the chat room and after editing and making it all work, it seems fine but the "people already in the chat room" information appears in the same area and the text; [http://i73.photobucket.com/albums/i206/ronaldostepovers/chatroom.jpg] Does anyone know how I ...

22. JFrame - extra box?    forums.oracle.com

That box is your JFrame. Comment out frame.setVisible(true) Presumably you will actually want to do something with the frame later, otherwise you can remove it entirely and replace the frame in your message method with null. Btw, this should really be in the Swing forum and you should use the code tags because it's easier to read. Edited by: Edward_Kimber on ...

23. Proper JFrame Garbage Collection or Destroying    forums.oracle.com

Here's the situation -- I have a form (JFrame A) that takes a few inputs from the user. Once the user finished, he clicks submit then JFrame A disappears and JFrame B appears. JFrame A will never be used again. I have not explicitly told Java to destroy JFrame A. So should I create code that explicitly destroys JFrame A or ...

24. Please help. JFrame question    forums.oracle.com

26. JFrame not responding to code?    forums.oracle.com

28. prevent to runs *.jar twice and instead show the original JFrame    forums.oracle.com

hii, could you please help me with this scenario: 1/ I knew these ways, how to avoid starting the second window (JFrame) - lock local port, - write "lock file", - write "lock row" to db, my question ---> is there exists any way, there are other cleaner and more direct way?, 2/ instead of exit events, only to send JFrame.setVisible ...

29. set name of JFrame in Netbeans    forums.oracle.com

Hi, I am using the GUI builder in netbeans to create my application. This means that all the components are created in InitComponents() and I cannot access these components to change them. What I need to be able to do is to give my JFrame a name so that I can set properties on the Frame. Ultimately what I want to ...

30. Can't find JFrames in Netbeans anymore    forums.oracle.com

31. need Help on JFrame    forums.oracle.com

32. sending JFrame in response    forums.oracle.com

33. making a jframe that i can put input into....    forums.oracle.com

34. Can't fll in spawned JFrame!!    forums.oracle.com

35. How to access any elements of a SWING JFRAME from another class???    forums.oracle.com

Hellos.... Stuck in a problem... I have a written a swing program in which I am calling some other classes from ActionListener of it's button. Now I want to access the elements of that frame from other classes (and to change their values accordingly). Is it possible to do? If yes, can you show me how to do it? Please give ...

36. Programming for JFrame    forums.oracle.com

You must implement a method move. This method takes two int[]s, zx and zy, giving the locations of all the zombies, along with ints x and y giving your location. Your method should return "S" to stand still, or "R", "L", "U", or "D" for the four cardinal directions, and "RU", "RD", "LU", or "LD" for the four diagonal directions: LU ...

37. JFrame    forums.oracle.com

Anyone else find it strange that JFrame only aligns pieces along 8 of its axes? maybe it would be better to use coords system. but I suppose this would only help if the frame had focus. of course its only a suggestion but something should be done regarding this. may be in the next edition. Of course they won't do it ...

38. Swings-JFrame    forums.oracle.com

39. jframe doesn't appear when running app    forums.oracle.com

40. Jframe    forums.oracle.com

Hey im very much a beginner to java but am adiment to learn its ways can anyone help me with this program and tell me whats the problem ( you'll proberly find it silly but we all start somewhere) import javax.swing.*; import java.awt.*; import java.awt.event.*; public class chingChongCha extends JFrame { public chingChongCha() { super (" CHING CHONG CHA "); setSize ...

41. Visual Class Jframe    forums.oracle.com

42. Regarding JFrame Doubt    forums.oracle.com

43. Adding music to a JFrame    forums.oracle.com

45. jframe wont disapear    forums.oracle.com

Swing related questions should be posted in the Swing forum. ok it works if i take out the drawcanvas stuff but it wont work with it Well then do some basic debugging. Start with a simple JPanel and see if it works. Then override the paintComponent() method and see if it works. Then implement the KeyListener and see if it works. ...

46. Trying to make Java run in a Jframe    forums.oracle.com

What's that? I'm completely new at this. Whenever I hear of a Swing app freezing, I think of a concurrency issue which is probably the most common cause for this. All events that Swing deals with (button presses, keyboard clicks, timer ticks) are handled on a single thread, the Event Dispatch Thread or EDT. Likewise Swing does all of its drawing ...

47. Pipe outputstream to a JFrame    forums.oracle.com

System.out.println("This is a last messgae from the child"); } } =============== package com.test; import java.awt.BorderLayout; import java.io.IOException; import java.io.InputStream; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextArea; class MyFrame extends JFrame{ JTextArea text = new JTextArea(); InputStream is = null; public MyFrame(InputStream is){ this.is = is; getContentPane().setLayout(new BorderLayout()); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); getContentPane().add(new JScrollPane(text),BorderLayout.CENTER); pack(); setVisible(true); t.start(); }

48. Writing a network program using JFrame with a Client and a Server.    forums.oracle.com

I want to make a multiplayer network program using java. There should be four programs. 1)Client.java(extends JFrame) 2)ClientApli.java(with the main methoud) 3)Server.java(extends runnable) 4)ServerApli.java My teacher told me to make a game. He told me to let every client have a different color boat on the same server. And all the clients compete to get fuel which is randomly placed one ...

49. Swing - JFrame - contentPane    forums.oracle.com

I've seen a Swing forum for Swing questions. But people still seem to post all the questions in the Java forum. Why did the forum designers create a Swing forum if everyone is still going to post Swing questions in the General Java forum? Yet another mystery. Which one will be solved first, why people don't post in the correct forum ...

50. how to put picture or ascii art in jframe.....    forums.oracle.com

hi guys....., am a newbie in java, i found difficulties when am trying to put picture or an ascii art in jframe, maybe u guys can give me some hints....(based on my code),here i submit a part of my code in jframe section:... import java.awt.*; import javax.swing.*; import java.awt.Color; import javax.swing.JOptionPane; import java.util.Date; class MyFrame extends JFrame { public void paint ...

51. Picture in JFrame    forums.oracle.com

52. JFrame Unload ?    forums.oracle.com

Folks, I'm mucking around with Swing just for fun. I've bodgied-up a JTable which displays "select count * from" +tableName. The TableModel uses the underlying RecordSet directly, rather than "re-cache" the results in an array/ArrayList/Vector. My problem is that I should really close the underlying RecordSet when the user closes the form, but I can't work out how to "hook" the ...

53. my JFrame wanted    forums.oracle.com

54. Can you do this with JFrames?    forums.oracle.com

I have two elements I need to incorporate into the interface of a current project. Luckily, instead of me explaining (badly) what these are, I have found an image which has both of them in. Here: http://livehelp.stardevelop.com/images/messenger5.png The first thing I need to determine is whether java supports the "heading/surrounding border" element which is shown on the upper half of the ...

55. Line disappearing on JFrame    forums.oracle.com

Hi, I have to draw a Colored line just beneith the JMenuBar in application and paste a image on the right hand side of JMenuBar. Line is disappearing if application resize is done or any other task on application. 1: How to redraw the line every time any updation is done on application. 2: How to place an image on the ...

56. How to get pixels from a JFrame / JComponent    forums.oracle.com

57. JFrame Help!    forums.oracle.com

58. JFrame and bar of the applications    forums.oracle.com

59. the rest of the JFrames    forums.oracle.com

60. JFrame    forums.oracle.com

61. Unit Testing : JFrame etc remains once tests have been executed.    forums.oracle.com

When I run all my test methods, once complete I am left with 34 windows open (this just displays information so my program can be used). I tried adding game1.quit(); to the end of each test method for one of the test units, but then that particular test errors and says: "VM restarted". I then tried placing the call for exit ...

62. How to sent information between JFrames!?    forums.oracle.com

It's story time again. Aliens land on Earth and somehow end up at a concert hall, watching a conductor lead an orchestra. They are enraptured by what they hear and decide to observe with care, so that they can implement this on their home planet. They watch and note that when the conductor moves his baton so, all the violins' bows ...

63. [Netbeans][JFrame] - preview diffrent than effect    forums.oracle.com

If you put that block of code in the init of your form you won't have to explicitly call it. I have a private method that I add to subclasses of JFrame called _init() that handles this along with several other default behaviors that I usually want. _init() is called during construction of the object. PS.

64. Really simple question about JFrames    forums.oracle.com

65. JFrame (Frame) question relating to centering    forums.oracle.com

66. Decomplie JFrame using JAD    forums.oracle.com

Hey I was unable to find a suitable forum for this topic...apologises if in the wrong domain. The issue - when attempting to decompile a JFrame byte code (class) file with JAD a series of errors are generated which are beyond my level of understanding. I have successfully decompiled some entity class files (data objects) without any errors. Essentially I am ...

67. JFrames again..    forums.oracle.com

68. Sound in a jFrame    forums.oracle.com

Hi, just want to ask if anyone has any code samples to play files using a jFrame (not an applet) using the javax.sound.sampled package. All I am trying to do is play a sound file that is already defined in the code when I press a button. All I can find are complex programs and 2 page long explanation documents. Any ...

69. Help with Jframe!    forums.oracle.com

70. Need help creating a Jframe    forums.oracle.com

Person p1 = new Person ("Sloan", "Mergler", "4 vanderbilt drive", "516-551-0829", b1, Relation_type.FRIEND ); Person p2 = new Person ("Taylor", "Bowne", "21 greywood street", "516-944-6812", b2, Relation_type.FRIEND); // these are random numbers for birthdays Person p3 = new Person ("Daniel", "Py", "21 roger drive apt 2", "516-944-7530", b3, Relation_type.FAMILY_MEMBER); Person p4 = new Person ("Richard", "Py", "21 roger drive apt 1", ...

71. Anyway to center a JFrame??    forums.oracle.com

72. Encapsulating JFrames    forums.oracle.com

Swing related questions should be posted in the Swing forum. JFrames use a "content pane" to hold all the GUI components. Its simply a JPanel with child components added to it. So you can use frame.getContentPane() for each frame add the resulting panels to another frame/dialog/window, or whatever. But remember a component can only have a single parent.

73. Equivalent of this.getCodeBase () for JFrame?    forums.oracle.com

74. Using audioclips in JFrame    forums.oracle.com

75. JFrame named Ghost    forums.oracle.com

76. Set width of JFrame only    forums.oracle.com

77. servlets and jframe    forums.oracle.com

78. How does a jframe communicate with other classes???    forums.oracle.com

Hello people, sorry for my bad english and for my question that can be very dumb. But how does the frame communicate with other casses? Ok, my situation is the follow, i have a main class that contains : 1- a array of class 'employees' and 2- two 'frames' ( 'startscreen' and 'addemployee' screen) My intention is: 1- in main class ...