Register FAQ Calendar Search Today's Posts Mark Forums Read

Go Back   Java Programming Forums > Java Programming > New to Java

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-11-2008, 08:02 PM
Junior Member
 
Join Date: Oct 2008
Location: bangladesh
Posts: 6
shawon barua is on a distinguished road
Post want code

i need a program code that will contain balance of 3 customer.the program will contain a class that has the following member

Data member:1.account number
2.name
3.balance

Methods:1.to initialize the balance
2.to deposit in balance
3.to withdraw from a balance
4.to display account no.,name, & final balance
Reply With Quote
  #2 (permalink)  
Old 02-11-2008, 02:41 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: want code

Hello shawon,

Welcome to the Java Programming Forums.

Have you started to write the code yourself yet?

People here will be reluctant to do your entire project for you but we will always be happy to help you expand on what you already have.
Thats the best way to learn after all.

Please post the code you have and I will help you with any problems
Reply With Quote
  #3 (permalink)  
Old 08-11-2008, 04:36 PM
Junior Member
 
Join Date: Oct 2008
Location: bangladesh
Posts: 6
shawon barua is on a distinguished road
Red face Re: mycode

Java Code:
import java.util.Scanner;
class DataOfRoom
{
float width;
float height;
float depth;
float length;
float radious;
 
DataOfRoom(float width,float height,float depth) 
{
this.width=width;
this.height=height;
this.depth=depth;
} 
 
 
DataOfRoom(float radious) 
{
this.radious=radious;
} 
 
DataOfRoom(float length) 
{
width=height=depth=length;
} 
void volume()
{
double rectangle=(double)width*height*depth; 
double circle=(double)2*3.1416*radious;
double square=(double)length*length*length;
}
 
void area()
{
double rectangle=(double)width*height; 
double circle=(double)3.1416*radious*radious;
double square=(double)length*length;
} 
}
 
class Room
{
public static void main(String args[])//throws IOException 
{
BufferedReader BR=new BufferedReader(new InputStreamReader(System.in)); 
float width1,height1,depth1,length1,radious1;
System.out.println("ENTER WIDTH OF RECTANGLE");
width1=input.nextFloat();
 
System.out.println("ENTER HEIGHT OF RECTANGLE");
height1=input.nextFloat();
 
System.out.println("ENTER DEPTH OF RECTANGLE");
depth1=input.nextFloat();
 
System.out.println("ENTER LENGTH OF SQUARE");
length1=input.nextFloat();
 
System.out.println("ENTER radious OF RECTANGLE");
radious1=input.nextFloat();
 
DataOfRoom myRectangle=new DataOfRoom(width,height,depth);
 
DataOfRoom myCircle=new DataOfRoom(radious);
 
DataOfRoom mySquare=new DataOfRoom(length);
 
} 
}
this is the code i have.now i'm having problem of this program in taking input.
the program will find out area & volume of rectangle,circle,square.
wish quick reply.

Last edited by shawon barua; 25-12-2008 at 07:24 PM.
Reply With Quote
  #4 (permalink)  
Old 08-11-2008, 06:26 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: want code

I can see you are trying to use the scanner class to take user input but you are not using the correct code.
In the code you have submitted you are using a BufferedReader.

Try this, Ive changed the Room class:

Java Code:
class Room
{
 
public static void main(String args[])//throws IOException 
{
//BufferedReader BR=new BufferedReader(new InputStreamReader(System.in));
Scanner sc = new Scanner(System.in);
 
float width1,height1,depth1,length1,radious1;
System.out.println("ENTER WIDTH OF RECTANGLE");
width1=sc.nextFloat();
 
System.out.println("ENTER HEIGHT OF RECTANGLE");
height1=sc.nextFloat();
 
System.out.println("ENTER DEPTH OF RECTANGLE");
depth1=sc.nextFloat();
 
System.out.println("ENTER LENGTH OF SQUARE");
length1=sc.nextFloat();
 
System.out.println("ENTER radious OF RECTANGLE");
radious1=sc.nextFloat();
 
DataOfRoom myRectangle = new DataOfRoom(width,height,depth);
 
DataOfRoom myCircle = new DataOfRoom(radious);
 
DataOfRoom mySquare = new DataOfRoom(length);
 
} 
}
This is now using the scanner class to take user input from the console.
I still had errors when I tried to compile the code but the input is being fead in correctly.
Reply With Quote
  #5 (permalink)  
Old 09-11-2008, 05:07 PM
Junior Member
 
Join Date: Oct 2008
Location: bangladesh
Posts: 6
shawon barua is on a distinguished road
Default Re: want code

/* In a class hierarchy, private members remain
private to their class.

This program contains an error and will not
compile.
*/

Java Code:
// Create a superclass.
class A {
int i; // public be default
private int j; // private to A
 
void setij(int x, int y) {
i = x;
j = y;
}
}
 
// A's j is not accessible here.
class B extends A {
int total;
 
void sum() {
total = i + j; // ERROR, j is not accessible here
}
}
 
class Access {
public static void main(String args[]) {
B subOb = new B();
 
subOb.setij(10, 12);
 
subOb.sum();
System.out.println("Total is " + subOb.total);
}
}
actually i don't want to put out private.i want to access j when private is used.with any method or system

Last edited by shawon barua; 09-11-2008 at 05:46 PM.
Reply With Quote
  #6 (permalink)  
Old 09-11-2008, 05:35 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: want code

Hey,

In future can you please post all your code within the [code] [ /code] tags. Thanks.

This sounds like course work! Can you change the int variables access type? If so, simply change it from private to public.

Java Code:
// Create a superclass.
class A {
int i; // public be default
public int j; // private to A
 
void setij(int x, int y) {
i = x;
j = y;
}
}
 
// A's j is not accessible here.
class B extends A {
int total;
 
void sum() {
total = i + j; // ERROR, j is not accessible here
}
}
 
class Access {
public static void main(String args[]) {
B subOb = new B();
 
subOb.setij(10, 12);
 
subOb.sum();
System.out.println("Total is " + subOb.total);
}
}
Reply With Quote
  #7 (permalink)  
Old 10-11-2008, 01:40 PM
Junior Member
 
Join Date: Nov 2008
Posts: 11
Fendaril is on a distinguished road
Default Re: want code

Well I read in the code that the int j & i are set to public by default if there is nothing else is specified. I think it would be more readable if he didnt put "private" or "public" and just left it.
Reply With Quote
  #8 (permalink)  
Old 10-11-2008, 02:55 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: want code

You are correct that the access modifier will be set to public by default but its good coding practise to write the correct access modifier even if you want the variable to be public.

It makes it easier to read and if you are collaborating on an application then your best to show exactly what you are doing.

Seeing as your new to Java id make every effort to write well written, concise code without cutting any corners.
Reply With Quote
  #9 (permalink)  
Old 23-12-2008, 03:40 PM
Junior Member
 
Join Date: Oct 2008
Location: bangladesh
Posts: 6
shawon barua is on a distinguished road
Lightbulb Re: modify the code

Java Code:
import java.io.*;
import java.awt.*;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JFrame;
import java.awt.Panel;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.MenuBar;
import java.awt.Menu;
import java.awt.MenuItem;
import javax.swing.JScrollBar;
import java.awt.TextField;
import javax.swing.JOptionPane;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.SwingConstants;



class PanelTest extends JFrame

{
	int i,j=0;
	int x=190;
	int row=135;
	int colum=190;
	
	MenuItem autoSum,autoAverage,min,max;
	 MenuItem system;



    
    Panel panel1=new Panel();//button panel for up buttons
    Panel panel2=new Panel();//button panel for side buttons
    Panel panel3=new Panel();//button panel for formula bar

    Panel fieldPanel=new Panel();//Text field panel for textfield


    //declaration of buttons
         JButton button[]=new JButton[10];//button for side


	      JButton  button1=new JButton("A");
	      JButton  button2=new JButton("B");
	      JButton button3=new JButton("C");
	      JButton button4=new JButton("D");
	      JButton button5=new JButton("E");
	      JButton button6=new JButton("F");
	      JButton button7=new JButton("G");
	      JButton button8=new JButton("H");
	      JButton button9=new JButton("I");
	      JButton button10=new JButton("J");
		 JButton t1=new JButton ("RESULT");
		  JButton t3=new JButton ("ENTER FORMULA");
		   JButton t4=new JButton ("CLICK HERE");
//declaration of textfields

        TextField t[][]=new TextField[10][10];
        TextField t2=new  TextField("");

        public PanelTest()
        	{
        		super ("SIMPLE ARITHMETIC EVALUTION 2.1");//constructor for title bar

        		Container c=getContentPane();

        	//	fieldPanel.setLayout(new GridLayout(10,10,1,1));//set layout for textfield






        		for(i=0;i<10;i++)
        			{
						for(j=0;j<10;j++)
						{
        				   	 t[i][j]=new TextField(" ");
        				   	 t[i][j].setBounds(row,colum,70,25);
        				     fieldPanel.add(t[i][j]);
        				     row=row+75;
					    }
					    row=135;
					    colum=colum+30;
        			}


        			for(int i=0;i<10;i++)
        			{
        			     button[i]=new JButton(""+(i+1));
        			     panel2.add(button[i]);

        			}





					button1.setBounds(135,160,70,25);
					button2.setBounds(210,160,70,25);
					//button2.setForGround(Color.red);
					button3.setBounds(285,160,70,25);
					button4.setBounds(360,160,70,25);
					button5.setBounds(435,160,70,25);
					button6.setBounds(510,160,70,25);
					button7.setBounds(585,160,70,25);
					button8.setBounds(660,160,70,25);
					button9.setBounds(735,160,70,25);
					button10.setBounds(810,160,70,25);
					t1.setBounds(60,510,270,90);
					t3.setBounds(330,510,270,45);
					t4.setBounds(600,510,270,90);
					t2.setBounds(330,555,270,45);
					panel3.add(t1);
					panel3.add(t3);
					panel3.add(t4);
					panel3.add(t2);

					//wok for side bottons
					for(i=0;i<10;i++)
					{
					button[i].setBounds(60,x,70,25);
					x=x+30;
				}


					 c.add(button1);
                    c.add(button2);
                   c.add(button3);
                    c.add(button4);
                    c.add(button5);
                    c.add(button6);
                    c.add(button7);
                    c.add(button8);
                    c.add(button9);
                    c.add(button10);
                    c.add(t1);
                    c.add(t3);
                    c.add(t4);
                    c.add(t2);

                    for(i=0;i<10;i++)
                    {
                    	c.add(button[i]);
				}
				c.add(panel2);
				for(i=0;i<10;i++)
				{
					for(j=0;j<10;j++)
					{
						c.add(t[i][j]);
					}
				}
                  c.add(fieldPanel);
                   c.add(panel3);




        /*work of bar*/
         			MenuBar bar=new MenuBar();
					setMenuBar(bar);
                //fileMenu start
					Menu fileMenu=new Menu("File");
              	    MenuItem newFile=new MenuItem("New File .......Alt N");
					MenuItem openFile=new MenuItem("Open File .....Alt O");
        	        MenuItem exitFile=new MenuItem("Exit ...........Alt  Esc");
        	        fileMenu.add(newFile);
        	        fileMenu.add(openFile);
        	        fileMenu.add(exitFile);
					bar.add(fileMenu);

                //About Menu star
               		 Menu aboutMenu=new Menu("About");
               		 MenuItem project=new MenuItem("Our Project");
               		 MenuItem project1=new MenuItem("Other Project");
               		 aboutMenu.add(project);
               		 aboutMenu.add(project1);
               		 bar.add(aboutMenu);

                //View Menu
               		 Menu viewMenu=new Menu("View");
               		 Menu devlopersProfile=new Menu("Devlopers Profile");

               		 MenuItem zeroEightProfile=new MenuItem("08 Profile");

               		 MenuItem rony=new MenuItem("MD.SHIFUDDIN AL MASUD");
               		 MenuItem banna=new MenuItem("TARAK AMAN BANNA");
               		 MenuItem joy=new MenuItem("DEBASHIS CHAKROBORTI");
               		 MenuItem shawon=new MenuItem("SHAWON BORUA");
               		 MenuItem shristi=new MenuItem("SHRISTI SUMONA NATH");
               		 MenuItem toma=new MenuItem("TOMA HATI");

               		 devlopersProfile.add(rony);
               		 devlopersProfile.add(banna);
               		 devlopersProfile.add(joy);
               		 devlopersProfile.add(shawon);
               		 devlopersProfile.add(shristi);
               		 devlopersProfile.add(toma);
               		 viewMenu.add(devlopersProfile);
               		 viewMenu.add(zeroEightProfile);
               		 bar.add(viewMenu);

                //HELP MENU

               		Menu  help=new Menu("Help");
               		   system=new MenuItem("HOW TO RUN");
               		   help.add(system);
               		 bar.add(help);

               	 //action menu
               		 Menu action=new Menu("Action");
               		 autoSum=new MenuItem("Auto Sum");
               		 autoAverage=new MenuItem("Auto Average");
                	 MenuItem autoMultiply=new MenuItem("Auto Multiply");
                	 MenuItem min=new MenuItem("Minumum");
                	 MenuItem max=new MenuItem("Maximum");
                	action.add(autoSum);
                	action.add(autoAverage);
                	action.add(autoMultiply);
                	action.add(min);
                	action.add(max);
                	bar.add(action);

                	show();
                	TextFieldHandler handler = new TextFieldHandler();
                	for(i=0;i<10;i++)
               		{
				   		for(j=0;j<10;j++)
				   		{
		    	     		t[i][j].addActionListener(handler);
				 		}
		       		}
               		help.addActionListener(handler);
               		autoSum.addActionListener(handler);
             		autoAverage.addActionListener(handler);
             		t4.addActionListener(handler);
             		min.addActionListener(handler);
             		max.addActionListener(handler);
             		system.addActionListener(handler);
          }

 		class TextFieldHandler implements ActionListener

		{

			int sum=0,sum1=0,sum2=0,mul=1,i=0,j=0,minimum=0,l=0,maximum=0,length=0,location=0,length1=0,length2=0,counter1=0,counter2=0,counter11=0,counter22=0;
			int a[]=new int[100];
			char array[]=new char[10];
			char array1[]=new char[10];
			char array2[]=new char[10];
			//MyPanel ob=new MyPanel();

    	    public void actionPerformed( ActionEvent event )
			{
		 		String string ,string1;
		 		sum=0;
		 		mul=1;


		 		if(event.getSource()==system)
								{
									Help myhelp=new Help();
									myhelp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
									myhelp.setSize(800,700);
									myhelp.setVisible(true);


				}

				if(event.getSource()==t4)
		 		{	l=0;

					//t[9][9].setText("");
					for(i=0;i<10;i++)
					{	for(j=0;j<10;j++)
            			{	string=t[i][j].getText();
		       				 string1="0"+string.trim();
		       				a[l]=Integer.parseInt(string1);
		       				l++;

		   				}
		   			}

					string=t2.getText();
					string1=string.trim();
		    		length=string1.length();

		    		string1.getChars(0,(length),array,0);

					for(i=0;i<length;i++)
		    		{	if(array[i]=='+'||array[i]=='-'||array[i]=='*')
						{	location=i;
						}
					}

		   			for(i=0;i<location;i++)
		   			{	array1[i]=array[i];
			   			length1++;
		   			}
					j=0;
					if(length-length1==4)

					{
			   			array2[0]=array[location+1];
			   			array2[1]=array[location+2];
			   			array2[2]=array[location+3];
			   			//JOptionPane.showMessageDialog(null,"  "+(length-length1));

				    }

				    else
				    {
				    	array2[0]=array[location+1];
						array2[1]=array[location+2];
						//JOptionPane.showMessageDialog(null,"  "+(length-length1));
				    }



		   			if(length1==3)
		   			{	 i=9;
				   		if(array1[0]=='a')
				   		j=0;
				   		if(array1[0]=='b')
				   		j=1;
				   		if(array1[0]=='c')
				   		j=2;
				   		if(array1[0]=='d')
				   		j=3;
				   	    if(array1[0]=='e')
				   		j=4;
				   		if(array1[0]=='f')
				   		j=5;
				   	    if(array1[0]=='g')
				   		j=6;
				   		if(array1[0]=='h')
				   		j=7;
				   		if(array1[0]=='i')
				   	    j=8;
				   		if(array1[0]=='j')
				   		j=9;
				   		  i=i*10;
							j=i+j;
			         sum1=j;
				   		//JOptionPane.showMessageDialog(null,"  "+(j)+"  "+i);
                    }
		   			else
		   			{	if(array1[0]=='a')
			   			j=0;
						if(array1[0]=='b')
			   			j=1;
			  			if(array1[0]=='c')
			   			j=2;
			   			if(array1[0]=='d')
			   			j=3;
			   			if(array1[0]=='e')
			   			j=4;
			   			if(array1[0]=='f')
			   			j=5;
			   			if(array1[0]=='g')
			   			j=6;
			   			if(array1[0]=='h')
			   			j=7;
			   			if(array1[0]=='i')
						j=8;
						if(array1[0]=='j')
			   			j=9;
						if(array1[1]=='1')
			   			i=0;
			   			if(array1[1]=='2')
			   			i=1;
			   			if(array1[1]=='3')
			   			i=2;
			   			if(array1[1]=='4')
			  			i=3;
			   			if(array1[1]=='5')
			   			i=4;
			   			if(array1[1]=='6')
			   			i=5;
			   			if(array1[1]=='7')
			   			i=6;
			   			if(array1[1]=='8')
			   			i=7;
			   			if(array1[1]=='9')
			   			i=8;


			         i=i*10;
			         j=i+j;
			         sum1=j;
				 }
			         //JOptionPane.showMessageDialog(null,"position  "+(sum1));


				     if((length-length1)==4)
					 {	int i=9;
						if(array2[0]=='a')
						j=0;
						if(array2[0]=='b')
						j=1;
						if(array2[0]=='c')
						j=2;
						if(array2[0]=='d')
						j=3;
						if(array2[0]=='e')
						j=4;
						if(array2[0]=='f')
						j=5;
						if(array2[0]=='g')
						j=6;
						if(array2[0]=='h')
					    j=7;
						if(array2[0]=='i')
						j=8;
						if(array2[0]=='j')
						j=9;

						i=i*10;
					 j=i+j;
                     sum2=j;

					}
					else
					{	if(array2[0]=='a')
						 j=0;
						 if(array2[0]=='b')
						 j=1;
						 if(array2[0]=='c')
						 j=2;
						 if(array2[0]=='d')
						 j=3;
						 if(array2[0]=='e')
						 j=4;
						 if(array2[0]=='f')
						 j=5;
						 if(array2[0]=='g')
						 j=6;
						 if(array2[0]=='h')
						 j=7;
						 if(array2[0]=='i')
						 j=8;
						 if(array2[0]=='j')
						 j=9;
						 if(array2[1]=='1')
						 i=0;
						 if(array2[1]=='2')
						 i=1;
						 if(array2[1]=='3')
						 i=2;
						 if(array2[1]=='4')
						 i=3;
						 if(array2[1]=='5')
						 i=4;
						 if(array2[1]=='6')
						 i=5;
						 if(array2[1]=='7')
						 i=6;
						 if(array2[1]=='8')
						 i=7;
						 if(array2[1]=='9')
			             i=8;


                     i=i*10;
                     j=i+j;
                     sum2=j;
				 }

			        if(array[location]=='+')
			        {	sum=a[sum1]+a[sum2];
		   				string=String.valueOf(sum);
		   				t1.setText(string1+ "=" +string);
		   				//t1.setText(string);
	   				}

					if(array[location]=='-')
					{	int sub=a[sum1]-a[sum2];
					    string=String.valueOf(sub);
		   			    t1.setText(string1+ "=" +string);
		   			   // t1.setText(string);
				    }

					if(array[location]=='*')
					{	int mul=a[sum1]*a[sum2];
					    string=String.valueOf(a[sum1]*a[sum2]);
		   				t1.setText(string1+ "=" +string);
		   				//t1.setText(string);

					}

                 }


                 if(event.getSource()==autoAverage)
                 {
			 		sum=0;
			 		j=0;
			 		l=0;
			 		//t[9][9].setText("");
	     			for(i=0;i<10;i++)
            		{
						for(j=0;j<10;j++)
						{
	        		    	string=t[i][j].getText();
		         			string1="0"+string.trim();
		         			a[l]=Integer.parseInt(string1);
		         			l++;
			 			}
		    		}

					for(i=0;i<l;i++)
            		{	if(a[i]==0)
        	  			{
        	  				j++;
		  				}
          			}
          			j=0;

					for(i=0;i<l;i++)
           			{
           			 	sum=sum+a[i];
           			}
           			sum=sum/(100-(j-10));
           			string=String.valueOf(sum);
					t1.setText(string);

				}
				if(event.getSource()==autoSum)
         		{
					 sum=0;
					 j=0;
					 l=0;
					 t[9][9].setText("");
	     			for(i=0;i<10;i++)
            		{
						for(j=0;j<10;j++)
						{	string=t[i][j].getText();
		    	     		string1="0"+string.trim();
		         			a[l]=Integer.parseInt(string1);
		         			l++;
			 			}
		    		}
            		for(i=0;i<l;i++)
           			{
            			sum=sum+a[i];
           			}

           			string=String.valueOf(sum);
					t1.setText(string);

				}

				if(event.getSource()==min)
         		{	sum=0;
			 		j=0;
			 		l=0;
			 		t[9][9].setText("");
	     			for(i=0;i<10;i++)
            		{	for(j=0;j<10;j++)
						{	string=t[i][j].getText();
		         			string1="0"+string.trim();
		         			a[l]=Integer.parseInt(string1);
		         			l++;
			 			}
		    		}

            		minimum=a[0];

            		for(i=0;i<l;i++)
           			{	if(minimum>a[i])
            			minimum=a[i];
           			}
					string=String.valueOf(minimum);
					t[9][9].setText(string);
				}
				if(event.getSource()==max)
         		{
					 sum=0;
					 j=0;
					 l=0;
					 t[9][9].setText("");
	                 for(i=0;i<10;i++)
            		{	for(j=0;j<10;j++)
						{	 string=t[i][j].getText();
		        			 string1="0"+string.trim();
		        			 a[l]=Integer.parseInt(string1);
		        			 l++;
			 			}
		    		}

            		maximum=a[0];

            		for(i=0;i<l;i++)
           			{	if(minimum<a[i])
            			maximum=a[i];
           			}

           			string=String.valueOf(maximum);
					t[9][9].setText(string);

				}

			}
		}

}


 class Help extends JFrame
{
		JLabel label,label1,label2,label3,label4,label5,label6;
	//JButton button=new JButton("TYPES OF HELP");

	public Help()
	{
		super("THE WORDL OF HELP");

		setLayout(new FlowLayout());


		Icon photo=new ImageIcon(getClass().getResource("ron.jpg"));

		label=new JLabel();
		label1=new JLabel("ASs");
		label2=new JLabel();
		label3=new JLabel();
		label4=new JLabel();
		label5=new JLabel();
		label6=new JLabel();
		//label.setText("AUTO RUN::");
		/*+
		       "1.Frist enter nnumeric value to the textfield."+
		       "2.Click  Auto Sum for sum."+
		       "3.Click Auto Average to average"+
		       "4.Click Minimum to get the minimum value."+
		       "5.Click Maximum to get the miaximum value."+


		     "MANUAL MANIPULSATION::"+

		     "1.Frist enter nnumeric value to the textfield."+
		     "2.Enter address of the data at the formula bar"+
		     "3.Now press  RESULT button."+

		                 "THANK     YOU     SIR");
		                 */
		label.setIcon(photo);
		//label.setHorizontalTextPosition(SwingConstants.CENTER);
		//label.setVerticalTextPosition(SwingConstants.BOTTOM);
		label.setToolTipText("CSE THE ULTIMATE");
		add(label);
		label1.setText("AUTO RUN::");
		label1.setBounds(5,5,70,34);
		//label.setText("AUTO RUN::");
		//label.setText("AUTO RUN::");
		//label.setText("AUTO RUN::");
		add(label);
	}

}

class MyPanel
{
   public static void main(String a[])
    {
        PanelTest myTest=new PanelTest();
        myTest.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        myTest.setSize(900,700);
    }

}
This is the code.By this code i can add only 2 numbers.but i want to add so many numbers at once.please help me to modify this program.

Last edited by shawon barua; 25-12-2008 at 07:25 PM. Reason: the tag is given
Reply With Quote
  #10 (permalink)  
Old 23-12-2008, 04:06 PM
JavaPF's Avatar
Java Programmer
 
Join Date: May 2008
Location: Deep inside the Eclipse IDE
Posts: 172
JavaPF will become famous soon enoughJavaPF will become famous soon enough
Default Re: want code

Please add the code tags around your code!!

[ code] [/ code]

(without the spaces in the tags)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Custom Search
100 most searched terms
Search Cloud
"bad endpoint type" com.sun.xml.internal.messaging.saaj.soapexceptionimpl com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad endpoint type com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception com.sun.xml.messaging.saaj.soapexceptionimpl: java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed convert arraylist to map date_format_now eclipse shortcut keys ejb3 quartz java convert double to binary java forum java forums java jtextarea bold java jtextarea color java jtextarea font java jtextarea font size java programmer forum java programmers forum java programming forum java programming forums java read last line java read last line of file java sendkeys java.security.privilegedactionexception java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: bad response java.security.privilegedactionexception: com.sun.xml.internal.messaging.saaj.soapexceptionimpl: message send failed java.security.privilegedactionexception: com.sun.xml.messaging.saaj.soapexceptionimpl: message send failed javapf javaprogrammingforums jtextarea bold jtextarea font jtextarea font color jtextarea font size programing forums programming forums reset jcombobox saaj0008 saaj0008: bad response; bad request saaj0008: bad response; not found severe: saaj0008 severe: saaj0008: bad response; bad request severe: saaj0008: bad response; not found soap java.security.privilegedactionexception soapexceptionimpl: bad endpoint type textpad java

All times are GMT. The time now is 11:59 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.