Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa … class Frame { public static void main(String[] args) { JFrame frame = new JFrame("Bouncing Balls"); Ball[] b; // Start with 2…520, 540); // Set the frame size to 520x540 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Close the application when the frame is closed frame… Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 …this.getBounds().intersects(b.getBounds()); } } import javax.swing.JFrame; public class Frame{ public static void main( String args…[] ) { JFrame frame = new JFrame( "Bouncing Balls" ); Ball b[] = new Ball… Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa … " + collisionCount, 20, 20); } } Frame.java: import javax.swing.JFrame; public class Frame{ public static void main(String[] args…) { JFrame frame = new JFrame( "Bouncing Balls" ); Ball[] b = new Ball[2]; … Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Thank you so much for your reply and additions! It is certainly working as I wanted. I will read through the code you have added and ask you any questions I might have. I hope you don't mind. Regards Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by Dani I’ll mark this question solved :) Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by Dani … oh, sorry, missed the bit about you still needing clarifications. Feel feee to ask :) I’ll now unmark this topic as solved. /facepalm Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Hello, Thank you again so much! All your additions are clear, but it seems like whenever two balls collide, more than one ball is added to the arraylist and painted. Any way to have just one ball added to the panel for every collision? Have some kind of a toggle flag in paintcomponent? Regards Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by toneewa Yes, this is true. Overlapping ball spawns can do that causing a chain reaction. Something like that could be done. How you handle the spawning of the new ball is what I played with a bit before. You will see better collision detection changing to: g.fillOval(ball.getX(), ball.getY(), 1 * ball.getRadius(), 1 * ball.getRadius()); Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by jprog1000 Got it. Thank you so much! Re: Bouncing Balls: Creating a new ball when two balls collide Programming Software Development by aishamushtaq Hi, Its helpful for me. I got my answer. Re: JFrame/JDialog and Paint Programming Software Development by JamesCherrill JFrame has a paintComponent too. You can use this to paint whatever you want as the background for that JFrame. Check that everything inside the JFrame has setOpaque(false) if any controls are obscuring the background. Jframe help Programming Software Development by bebelove80 …...is it possible to do such a thing with a jframe? I've set up my frame layout with the design… I'm supposed to do. I've tried reading some jframe tutorials, but none seem to really answer my question or… Re: Jframe help Programming Software Development by masijade Use a JFrame only for the "main" dialog. Use a JDialog (or better yet a JOptionPane) for the "popups". Read the API docs for JDialog and JOptionPane (and JOptionPane and its "finished" methods are the way to go here). JFrame Programming Software Development by orcboyx Hello all, Does anyone have a good tutorial that explains how JFrame works and how it can be implemented? Re: JFrame Programming Software Development by Alex Edwards [url]http://java.sun.com/javase/6/docs/api/javax/swing/JFrame.html[/url] Re: JFrame? Programming Software Development by stultuske JFrame has nothing to do with JOptionPane. a JFrame can be used to create your own user screens, so yes, also a 'dialogbox' with as many input fields you need, in the layout you want it to be shown in. [URL="http://docs.oracle.com/javase/tutorial/uiswing/"]This[/URL] would be a good place to start learning how to create such screens. JFrame Disappears when Textfield added! Programming Software Development by umaima_1 …(new ActionListener(){ public void actionPerformed(ActionEvent e){ JFrame cr = new JFrame(); cr.setVisible(true); cr.setSize(600,200);…b4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ JFrame cr = new JFrame(); cr.setVisible(true); cr.setSize(300,100); cr… Re: JFrame Disappears when Textfield added! Programming Software Development by JamesCherrill That code is completely unreadable - blocks that go on forever, no comments, no indentation... But as far as I can see the order of creating the frame is maybe wrong and missing steps. You should: create the JFrame add all the components pack(); the JFrame (couldn't find this in your code) finally, make it visible. JFrame not showing up Programming by Wafflez …swing.JTextField; public class Login{ JFrame frame = new JFrame(); JButton loginButton = new JButton… * * @author cktas */ public class NewJFrame extends javax.swing.JFrame { /** * Creates new form NewJFrame */ public NewJFrame() { … Jframe appears with different size Programming Software Development by Saboor880 …which is running perfectly. But i am facing problems with jframe size on different machines. I have monitor of 'Gateway…shifted it on laptop of 'hp' company then my jframe and its child components appears very small. For example …and labels) appears very small. Similarly I have a jframe named Sale.java. I have set its property resizeable(false… Re: Jframe does not remember it' s position after minimizing Programming Software Development by amit.hak50 … = new JTextArea(10, 35); JScrollPane jscrollpane = new JScrollPane(ta); JFrame f = new JFrame("JScrollPane"); f.setUndecorated(false); f.setLocation(new… Re: JFrame and JPanel Programming Software Development by Violet_82 … of CreateFrame /*CreateFrameTest.java*/ import javax.swing.JFrame; public class CreateFrameTest{ public static void main(String… args){ CreateFrame createFrame = new CreateFrame(); createFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); createFrame.setSize( 300, 200); createFrame.setVisible( … JFrame from JApplet not opening in Google Chrome Programming Software Development by Kremlin …I upload it. Here's the code for the JFrame I'm trying to create: import java.awt.*; import… null; phpMain = new PHPHandler(); showGUI(); } public void showGUI() { final JFrame frame = new JFrame("Schedule"); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation… JFrame.DISPOSE_ON_CLOSE Programming Software Development by matthewborgcarr …attempt it works fine; it closes the JFrame and opens the login JFrame. However if the users clicks on …what I want is to always close the main JFrame when the user clicks the mentioned button. To close…frame I am using the following code: mainPanel.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); And in the action performed I am using… JFrame showing nothing. Programming Software Development by chdboy I'm not able to see content on JFrame ,when JFrame shows up. import java.awt.*; import javax.swing.*; … in another class which extends Frame JFrame newframe = new JFrame("Color Frame"); newframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); GraphicUse gu = new GraphicUse… Re: JFrame and JPanel Programming Software Development by Violet_82 …import java.awt.GridLayout; public class CreateFrame extends JFrame{ //create new JPanel private JPanel panel; private…(String[] args){ CreateFrame createFrame = new CreateFrame(); createFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); createFrame.setSize( 300, 200); createFrame.setVisible( true … Re: JFrame.DISPOSE_ON_CLOSE Programming Software Development by JamesCherrill Becuase the JFrame disposes correctly the first time, that shows the mainPanel variable correctly refers to that JPanel. Then you create a new JFrame for the second user, but the dispose doesn't work. So I wondered: is mainPanel still referring to the first JPanel, or do you update it to refer to the new JFrame you just created? Re: Jframe appears with different size Programming Software Development by JamesCherrill …. You use a layout manager to add these to the JFrame according to where you want them to go (top, bottom…, etc). The Layout Manager then sets the size of the JFrame to fit your components according to the layout you wanted… JFrame Won't Render Properly Programming Software Development by c0dex …I have decided to do, is have a pretty looking JFrame pop up informing the user of network usage when these…://www.brianmartinson.com/files/yes_filetransfer.png]screenshot[/url]) If the JFrame's .setVisible(true); call is made with the "…but that doesn't seem to help (probably because the JFrame call is on the same Thread). Any thoughts on what… JFrame reloading ContentPane Programming Software Development by bensjomic ….event.*; import javax.swing.*; /** * * @author Gebruiker */ public class Main extends JFrame{ public Main() { } //Container contentPane; public void changeRoot() { Container test = this…