Solved

JSlider option... how do I modify this code?

Posted on 2004-09-14
10
535 Views
Last Modified: 2008-01-09
Dear Experts,

I have to modify my current code and add a JSlider option.  Basically what I need to do at the end is to have the user be able to alter the radius with a JSlider.  The radii range must be between 100 and 200.  But when the JSlider is moved, the diameter, circumference, and area information is to be updated and displayed on the JFrame.  The initial radius should be set to 150.  So far I am able to have a random circle and its information displayed but I am not sure how or where I should implement the JSlider.  I am a beginner in java programming for my company I am working for and any help would be greatly appreciated.  Thank you.  This is what I have gotten once to show up (as far as the values are concerned) --- http://www.asiamarie.com/circle1.gif

Here is the code:

// Circle1.java
// Program draws a circle of a random
// diameter and displays the area, diameter,
// and circumference.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Circle1 extends JFrame {
   private CircleCanvas theCanvas;
   private JTextArea display;

   public Circle1()
   {
      super( "Circle1" );
      theCanvas = new CircleCanvas();
      display = new JTextArea( 5, 30 );

      display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );

      //setLayout( new BorderLayout() );
      getContentPane().add( theCanvas, BorderLayout.CENTER );
      getContentPane().add( display, BorderLayout.SOUTH );
      setSize( 200, 200 );
      show();
   }

   public static void main( String args[] )
   {
      Circle1 app = new Circle1();

      app.addWindowListener(
         new WindowAdapter() {
            public void windowClosing( WindowEvent e )
            {
               System.exit( 0 );
            }
         }
      );
   }
}

class CircleCanvas extends JPanel {
   private int radius;

   public CircleCanvas()
   {
      radius = ( int )( 1 + Math.random() * 100 );
      setSize( 100, 100 );
   }

   public void paintComponent( Graphics g )
   {  g.drawOval( 0, 0, radius, radius );  }

   public int getDiameter()  {  return ( 2 * radius );  }

   public int getCircumference()
   {  return ( int )( 2 * Math.PI * radius );  }

   public int getArea()
   {  return ( int )( radius * radius * Math.PI );  }

   public int getRadius()  {  return radius;  }
}

 

0
Comment
Question by:adidas7fire
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 16

Expert Comment

by:suprapto45
ID: 12056354
I will help you. Wait for my codes.
0
 
LVL 16

Expert Comment

by:suprapto45
ID: 12056620
Since I cannot give you the whole codes directly.

Please read how to get the value of the JSlider.

private JSlider lagSlider;

lagSlider = new JSlider(JSlider.HORIZONTAL,1,100,1);
lagSlider.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
lagSlider.setPaintTicks(true);
lagSlider.addChangeListener(new SliderListener());    

class SliderListener implements ChangeListener {
      public void stateChanged(ChangeEvent e) {
          int lag=lagSlider.getValue();
          System.out.println(lag);
      }
    }

Remember, you must import some packages too. You have to find out :).
0
 

Author Comment

by:adidas7fire
ID: 12056811
well, that will get me started... thanks a bunch!  i'll see if i can't implement that somehow. ;-)
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12061507
modified source
ususally slider represents the percentage. hmmmm i am using it to get for radius.
// Circle1.java
// Program draws a circle of a random
// diameter and displays the area, diameter,
// and circumference.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;
public class Circle1 extends JFrame {
   private CircleCanvas theCanvas;
   private JTextArea display;
private JSlider lagSlider;
private JPanel panel = new JPanel();
private JPanel panel1 = new JPanel();
static Circle1 app ;
   public Circle1()
   {
      super( "Circle1" );
      theCanvas = new CircleCanvas();
      display = new JTextArea( 5, 30 );

      display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );

            lagSlider = new JSlider(JSlider.HORIZONTAL,1,100,1);
            lagSlider.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
            lagSlider.setPaintTicks(true);
            lagSlider.addChangeListener(new SliderListener());


            //panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
            panel.setLayout(new GridLayout(3, 1));

      panel.add(theCanvas);
      panel.add(display);
      panel.add(lagSlider);

      getContentPane().add( panel, BorderLayout.CENTER );
      setSize( 200, 200 );
      show();
   }

   public static void main( String args[] )
   {
      app = new Circle1();

      app.addWindowListener(
         new WindowAdapter() {
            public void windowClosing( WindowEvent e )
            {
               System.exit( 0 );
            }
         }
      );
   }


   class SliderListener implements ChangeListener {
        public void stateChanged(ChangeEvent e) {
            int lag= lagSlider.getValue();
            System.out.println(lag);

            theCanvas.setRadius(lag);
            theCanvas.repaint();
                  display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );
            app.repaint();
        }
    }
}

class CircleCanvas extends JPanel {
   private int radius;

   public CircleCanvas()
   {
      radius = ( int )( 1 + Math.random() * 100 );
      //setSize( 100, 100 );
   }

   public void paintComponent( Graphics g )
   {  g.drawOval( 0, 0, radius, radius );  }

   public int getDiameter()  {  return ( 2 * radius );  }

   public int getCircumference()
   {  return ( int )( 2 * Math.PI * radius );  }

   public int getArea()
   {  return ( int )( radius * radius * Math.PI );  }

   public int getRadius()  {  return radius;  }

   public void setRadius(int radius){this.radius = radius;}
}
0
 
LVL 5

Expert Comment

by:Naeemg
ID: 12062860
I've tried to solve ur problem. try this code now.

import javax.swing.*;
import java.awt.*;
import javax.swing.event.*;

public class Circle
    extends JFrame
{
  BorderLayout borderLayout1 = new BorderLayout();
  JSlider jSliderRadius = new JSlider();
  JTextArea display = new JTextArea(5, 30);
  private CircleCanvas theCanvas;

  public Circle()
  {
    try
    {
      jbInit();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  void jbInit() throws Exception
  {
    this.getContentPane().setLayout(borderLayout1);
    this.setTitle("Circle");
    theCanvas = new CircleCanvas();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );

    jSliderRadius.setMaximum(200);
    jSliderRadius.setMinimum(0);
    jSliderRadius.setValue(150);
    jSliderRadius.setOrientation(JSlider.HORIZONTAL);
    jSliderRadius.setMajorTickSpacing(10);
    jSliderRadius.setMinorTickSpacing(1);
    jSliderRadius.setPaintLabels(true);
    jSliderRadius.setPaintTicks(true);
    jSliderRadius.setPaintTrack(true);
    jSliderRadius.setToolTipText("Move slider to change the radius.");
    jSliderRadius.addChangeListener(new javax.swing.event.ChangeListener()
    {
      public void stateChanged(ChangeEvent e)
      {
        jSliderRadius_stateChanged(e);
      }
    });

    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.getContentPane().add( theCanvas, BorderLayout.CENTER );
    this.getContentPane().add(jSliderRadius, BorderLayout.NORTH);
    this.getContentPane().add(display, BorderLayout.SOUTH);
    this.setBounds(100,100,500,500);
  }

  void jSliderRadius_stateChanged(ChangeEvent e)
  {
    theCanvas.setRadius(jSliderRadius.getValue());
    theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                   "\nThe Diameter is: " + theCanvas.getDiameter()
                   + "\nThe Area is: " + theCanvas.getArea() +
                   "\nThe Circumference is: " +
                   theCanvas.getCircumference() );
  }
 
  //Main method
  public static void main(String[] args)
  {
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Circle thisCircle = new Circle();
    thisCircle.setVisible(true);
  }

}

class CircleCanvas
    extends JPanel
{
  private int radius;

  public CircleCanvas()
  {
    setRadius(50);
  }

  public void setRadius(int radiusSize)
  {
    radius = (int) (radiusSize + Math.random() * 100);
    setSize(5000, 100);
  }

  public void paintComponent(Graphics g)
  {
    g.drawOval(0, 0, radius, radius);
  }

  public int getDiameter()
  {
    return (2 * radius);
  }

  public int getCircumference()
  {
    return (int) (2 * Math.PI * radius);
  }

  public int getArea()
  {
    return (int) (radius * radius * Math.PI);
  }

  public int getRadius()
  {
    return radius;
  }
}
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:adidas7fire
ID: 12103532
Ok, after doing slight modifications to this code, I've gotten just about everything to work EXCEPT 1. when I run the application, the NORTH border cuts off the circle and the CENTER border has too much space for the text; 2. on the JSlider, the slider starts on 150 however it is not reflected on the radius in the text (i.e., the slider is defaulted to the value of 150 but if you run the application, it will choose a random radius value in the text.)  Here is the code and if you can offer any help or show me what I am doing wrong, please don't hesitate!  Thank you in advance.

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;

public class Circle
    extends JFrame
{
  BorderLayout borderLayout1 = new BorderLayout();
  JSlider jSliderRadius = new JSlider();
  JTextArea display = new JTextArea(5, 30);
  private CircleCanvas theCanvas;

  public Circle()
  {
    try
    {
      jbInit();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  void jbInit() throws Exception
  {
    this.getContentPane().setLayout(borderLayout1);
    this.setTitle("Circle");
    theCanvas = new CircleCanvas();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );

    jSliderRadius.setMaximum(200);
    jSliderRadius.setMinimum(0);
    jSliderRadius.setValue(150);
    jSliderRadius.setOrientation(JSlider.HORIZONTAL);
    jSliderRadius.setMajorTickSpacing(20);
    jSliderRadius.setMinorTickSpacing(10);
    jSliderRadius.setPaintLabels(true);
    jSliderRadius.setPaintTicks(true);
    jSliderRadius.setPaintTrack(true);
    jSliderRadius.setToolTipText("Move slider to change the radius.");
    jSliderRadius.addChangeListener(new javax.swing.event.ChangeListener()
    {
      public void stateChanged(ChangeEvent e)
      {
        jSliderRadius_stateChanged(e);
      }
    });

    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    this.getContentPane().add( theCanvas, BorderLayout.NORTH );
    this.getContentPane().add(jSliderRadius, BorderLayout.SOUTH);
    this.getContentPane().add(display, BorderLayout.CENTER);
    this.setBounds(100,100,500,300);
  }

  void jSliderRadius_stateChanged(ChangeEvent e)
  {
    theCanvas.setRadius(jSliderRadius.getValue());
    theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                   "\nThe Diameter is: " + theCanvas.getDiameter()
                   + "\nThe Area is: " + theCanvas.getArea() +
                   "\nThe Circumference is: " +
                   theCanvas.getCircumference() );
  }
 
  //Main method
  public static void main(String[] args)
  {
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Circle thisCircle = new Circle();
    thisCircle.setVisible(true);
  }

}

class CircleCanvas
    extends JPanel
{
  private int radius;

  public CircleCanvas()
  {
    setRadius(50);
  }

  public void setRadius(int radiusSize)
  {
    radius = (int) (radiusSize + Math.random() * 100);
    setSize(5000, 100);
  }

  public void paintComponent(Graphics g)
  {
    g.drawOval(0, 0, radius, radius);
  }

  public int getDiameter()
  {
    return (2 * radius);
  }

  public int getCircumference()
  {
    return (int) (2 * Math.PI * radius);
  }

  public int getArea()
  {
    return (int) (radius * radius * Math.PI);
  }

  public int getRadius()
  {
    return radius;
  }
}
0
 
LVL 6

Accepted Solution

by:
expertmb earned 500 total points
ID: 12108778
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;

public class Circle3
    extends JFrame
{
  BorderLayout borderLayout1 = new BorderLayout();
  JSlider jSliderRadius = new JSlider();
  JTextArea display = new JTextArea(5, 30);
  private CircleCanvas theCanvas;
      //this panel ADDED
  private JPanel panel = new JPanel();
  public Circle3()
  {
    try
    {
      jbInit();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  void jbInit() throws Exception
  {
    this.getContentPane().setLayout(borderLayout1);
    this.setTitle("Circle");
    theCanvas = new CircleCanvas();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );

    jSliderRadius.setMaximum(200);
    jSliderRadius.setMinimum(0);
    jSliderRadius.setValue(150);
    jSliderRadius.setOrientation(JSlider.HORIZONTAL);
    jSliderRadius.setMajorTickSpacing(20);
    jSliderRadius.setMinorTickSpacing(10);
    jSliderRadius.setPaintLabels(true);
    jSliderRadius.setPaintTicks(true);
    jSliderRadius.setPaintTrack(true);
    jSliderRadius.setToolTipText("Move slider to change the radius.");
    jSliderRadius.addChangeListener(new javax.swing.event.ChangeListener()
    {
      public void stateChanged(ChangeEvent e)
      {
        jSliderRadius_stateChanged(e);
      }
    });

    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    //this.getContentPane().add( theCanvas, BorderLayout.NORTH );
    //this.getContentPane().add(jSliderRadius, BorderLayout.SOUTH);
    //this.getContentPane().add(display, BorderLayout.CENTER);
    panel.setLayout(new GridLayout(3, 1));

      panel.add(theCanvas);
      panel.add(display);
    panel.add(jSliderRadius);
this.getContentPane().add(panel, BorderLayout.CENTER);
    this.setBounds(100,100,500,300);
  }

  void jSliderRadius_stateChanged(ChangeEvent e)
  {
    theCanvas.setRadius(jSliderRadius.getValue());
    theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                   "\nThe Diameter is: " + theCanvas.getDiameter()
                   + "\nThe Area is: " + theCanvas.getArea() +
                   "\nThe Circumference is: " +
                   theCanvas.getCircumference() );
  }

  //Main method
  public static void main(String[] args)
  {
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Circle3 thisCircle = new Circle3();
    thisCircle.setVisible(true);
  }

}

class CircleCanvas
    extends JPanel
{
  private int radius;

  public CircleCanvas()
  {
    setRadius(50);
  }

  public void setRadius(int radiusSize)
  {
    radius = (int) (radiusSize + Math.random() * 100);
    setSize(5000, 100);
  }

  public void paintComponent(Graphics g)
  {
    g.drawOval(0, 0, radius, radius);
  }

  public int getDiameter()
  {
    return (2 * radius);
  }

  public int getCircumference()
  {
    return (int) (2 * Math.PI * radius);
  }

  public int getArea()
  {
    return (int) (radius * radius * Math.PI);
  }

  public int getRadius()
  {
    return radius;
  }
}
0
 

Author Comment

by:adidas7fire
ID: 12111903
Expertmb,

Thanks for looking the code over.  I was comparing the previous code and the new code and yes, more room was added to the NORTH layout and less in the CENTER layout, but if I use the JSlider to enlarge the circle, it gets cut off.  I can't figure out why the JSlider may be set to 150 however it is not reflected on the text radius as being 150 as well... it's weird how I will move the slider to say, 170, but the result in the text area is something totally different.  Eventually, I plan to have it look like this picture I found on the net... http://www.asiamarie.com/circle1.gif
Thank you again for all your time and assistance on this.
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12120385
put below statements in jbinit after the

jSliderRadius.setToolTipText("Move slider to change the radius."); this statement.

theCanvas.setRadius(jSliderRadius.getValue());
  theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );



  public void setRadius(int radiusSize)
  {
    radius = radiusSize;//(int) (radiusSize + Math.random() * 100);
    setSize(5000, 100);
  }
0
 
LVL 6

Expert Comment

by:expertmb
ID: 12120994
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;

public class Circle3
    extends JFrame
{
  BorderLayout borderLayout1 = new BorderLayout();
  JSlider jSliderRadius = new JSlider();
  JTextArea display = new JTextArea(5, 30);
  private CircleCanvas theCanvas;
      //this panel ADDED
  private JPanel panel = new JPanel();
  public Circle3()
  {
    try
    {
      jbInit();
    }
    catch (Exception ex)
    {
      ex.printStackTrace();
    }
  }

  void jbInit() throws Exception
  {
    this.getContentPane().setLayout(borderLayout1);
    this.setTitle("Circle");
    theCanvas = new CircleCanvas();

    jSliderRadius.setMaximum(100);
    jSliderRadius.setMinimum(0);
    jSliderRadius.setValue(75);
    jSliderRadius.setOrientation(JSlider.HORIZONTAL);
    jSliderRadius.setMajorTickSpacing(10);
    jSliderRadius.setMinorTickSpacing(1);
    jSliderRadius.setPaintLabels(true);
    jSliderRadius.setPaintTicks(true);
    jSliderRadius.setPaintTrack(true);
    jSliderRadius.setToolTipText("Move slider to change the radius.");


    theCanvas.setRadius(jSliderRadius.getValue());
    theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                       "\nThe Diameter is: " + theCanvas.getDiameter()
                       + "\nThe Area is: " + theCanvas.getArea() +
                       "\nThe Circumference is: " +
                       theCanvas.getCircumference() );


    jSliderRadius.addChangeListener(new javax.swing.event.ChangeListener()
    {
      public void stateChanged(ChangeEvent e)
      {
        jSliderRadius_stateChanged(e);
      }
    });

    this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    //this.getContentPane().add( theCanvas, BorderLayout.NORTH );
    //this.getContentPane().add(jSliderRadius, BorderLayout.SOUTH);
    //this.getContentPane().add(display, BorderLayout.CENTER);

//    panel.setLayout(new GridLayout(3, 1));

      GridBagLayout gridbag = new GridBagLayout();
    GridBagConstraints c = new GridBagConstraints();

      panel.setLayout(gridbag);
      c.fill = GridBagConstraints.BOTH;
      c.weightx = 1.0;               //reset to the default
      c.gridwidth = 1;                  //reset to the default
      c.gridheight = 2;
      c.weighty = 1.0;
      c.gridwidth = GridBagConstraints.REMAINDER;

      gridbag.setConstraints(theCanvas, c);
      panel.add(theCanvas);

      c = new GridBagConstraints();
      c.fill = GridBagConstraints.BOTH;
      c.weightx = 0.0;               //reset to the default
      c.gridwidth = 1;                  //reset to the default
      c.gridheight = 1;
      c.gridwidth = GridBagConstraints.REMAINDER;
      gridbag.setConstraints(display, c);
      panel.add(display);

      c = new GridBagConstraints();
      c.fill = GridBagConstraints.BOTH;
      c.weightx = 0.0;               //reset to the default
      c.gridwidth = 1;                  //reset to the default
      c.gridheight = 1;
      c.gridwidth = GridBagConstraints.REMAINDER;
    gridbag.setConstraints(jSliderRadius, c);
    panel.add(jSliderRadius);
    this.getContentPane().add(panel, BorderLayout.CENTER);
    this.setBounds(100,100,400,500);
  }

  void jSliderRadius_stateChanged(ChangeEvent e)
  {

    theCanvas.setRadius(jSliderRadius.getValue());
    theCanvas.updateUI();
    display.setText( "The Radius is: " + theCanvas.getRadius() +
                   "\nThe Diameter is: " + theCanvas.getDiameter()
                   + "\nThe Area is: " + theCanvas.getArea() +
                   "\nThe Circumference is: " +
                   theCanvas.getCircumference() );
  }

  //Main method
  public static void main(String[] args)
  {
    try
    {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
    Circle3 thisCircle = new Circle3();
    thisCircle.setVisible(true);
  }

}

class CircleCanvas
    extends JPanel
{
  private int radius = 0;

  public CircleCanvas()
  {
    //setRadius(50);
  }

  public void setRadius(int radiusSize)
  {
    radius = ((getWidth()-50)*radiusSize)/100;//(int) (radiusSize + Math.random() * 100);
    setSize(getWidth(), getHeight());
  }

  public void paintComponent(Graphics g)
  {

    g.drawOval(0, 0, radius, radius);
  }

  public int getDiameter()
  {
    return (2 * radius);
  }

  public int getCircumference()
  {
    return (int) (2 * Math.PI * radius);
  }

  public int getArea()
  {
    return (int) (radius * radius * Math.PI);
  }

  public int getRadius()
  {
    return radius;
  }
}
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now