Results 1 to 2 of 2

Thread: GUI Issue

  1. #1
    Nakinsige is offline Member
    Join Date
    Jan 2012
    Rep Power

    Default GUI Issue

    Hi friends, i have an issue , I want to make JButton that will grow a circle. I have JButton in the frame using BorderLayout on the WEST side of the frame i want to link up the two so that when the JButton is clicked the circle will grow or become bigger. I have thought and reached max. Am a newbie
    Java Code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class GrowCircle extends JPanel {
    	int x = 225;
    	int y = 200;
    	JFrame frame;
    	public static void main(String[] args) {
    		GrowCircle g = new GrowCircle();
    	public void setUpScreen() {
    		JFrame frame = new JFrame();
    		CircleDrawPanel drawPanel = new CircleDrawPanel();
    		frame.setSize(500, 500);
    		JButton east = new JButton("Click me to grow the circle");
    		frame.getContentPane().add(BorderLayout.EAST, east);
    	class CircleDrawPanel extends JPanel {
    		public void paintComponent(Graphics g) {
    			g.fillOval(x, y, 50, 50);
    Last edited by DarrylBurke; 02-22-2012 at 11:13 AM. Reason: Fixed the code tag

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: GUI Issue

    You didn't bother to return to the last thread you started before asking this near-identical question here. Nor did you return to the cross post you started on JavaRanch. --edit: see my remarks in the thread linked in the next paragraph.

    I'm closing this thread. If you have anything to add, add it on your earlier thread:

    Last edited by DarrylBurke; 02-22-2012 at 03:54 PM.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Regular Expression issue and setName() method issue
    By geforce in forum New To Java
    Replies: 2
    Last Post: 01-30-2012, 04:33 AM
  2. How do I fix this issue?
    By m4mm4l in forum New To Java
    Replies: 8
    Last Post: 11-17-2011, 04:49 AM
  3. Same issue as before....
    By hayden06f4i in forum New To Java
    Replies: 4
    Last Post: 11-08-2010, 02:49 AM
  4. nio issue
    By mawandiadeepak in forum Networking
    Replies: 2
    Last Post: 03-17-2010, 06:23 AM
  5. Issue
    By chaitu444 in forum New To Java
    Replies: 2
    Last Post: 11-06-2007, 08:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts