i've a program in library management its GUI is running but the connectivity with MS-access is not getting done. please help me as soon as possible.
Here is the code
hi all,i want to access to a remote machine using it's ip adress to recover some information of computrs like (os,ip adresse,mac adress,list of installed software,....).
i I managed to recover those information but in a localhost i need your help to do that for a remote machine using java.
thikks for your comments. :)
Regarding RMIParikshit Kansara April 20, 2011 at 7:32 PM
hi,I am working on Traveling Tournament problem project.I have already implemented this project in java. running on single system.I want implement this project in distributed environment and how i can implement this using RMI??
Hello, I want to develop a Swing database application that uses database at remote location. Please help me to develop this. It should work similar to a J2EE application. Instead of using in browser, this should run like ordinary desktop application. what are the technology to be used?.
The program will input Data of Salesman Id, Item code, and number of cuestomer.
Sales id is 5digit long, and items code range from 100-300
if Item code is 100-150, display " aim high"
if item code is 150-200, display "good sales"
if item code is 250-300, display "excellent sales"
each customer should not purchase 3 items at once
final report should produce folling summary
Salesman ID Item code no of customers
12356 100 1
45678 112 2
kindly advise
//what is a output if error accured what is the reason
class a
{
public static void main(String args[])
{
byte a=10;
byte b=10;
byte c=a+b;
System.out.println(c);
}
}
Sir/Madam,
I am very keen to learn Java. Although your website has helped me emmensly with the 'New to Java' section, I want to learn further and slowly get expertise with the help of your website. Hence, I would like to know the process/flow to learn Java. I am getting confused with so many links. Could you please provide me the step by step links/Tutorials which I should follow in order to become a Java/J2EE professional.
Any help would be greatly appreciated.
Thank you.
Sukhendu.
write a java application for a video club that must do the following;
1)register new members
2)register new videos
3)be able to rent out or borrow videos
4)search videos from the database
Hi i've Jar file which runs successfully with built in inputs.
But i want to give inputs to the jar file through a file..can anyone explain?
doubt in ASCII Surya Krishna Bharath November 16, 2011 at 1:04 PM
hi sir/madam
i need your information that when 9 is char then it's ASCII is "57" is it posible to find that what is the ASCII value for "99"as a char.
sorry sir i am not able ask correctly what my doubt was ,so please excuse me and send me replay
I am just wondering how to write a program that finds the first palindromic prime number above 100,000 and i have to Include the value of this prime in a comment at the start of the code.
you are required to develop a simulation program on array-based list.
The array can store up to maximum ten integer
or string values.The application should be able to perform basic operations
such as inserting,deleting and displaying the array's content.
any extra operations are welcome.The application should prompt user a menu.
you are free to perform either forward or backward approach for inserting
process.for deleting purposes remove the most front element in the list.
Hello experts,
i am trying to read mail from gmail, which is working perfectly in the local machine. but when I update the server i am getting the following error .
javax.mail.MessagingException: Connect failed;
nested exception is:
java.net.ConnectException: Connection timed outfalse
The Code i am using is :
Session session = Session.getDefaultInstance(props, null);
Store store = session.getStore("imaps");
store.connect("imap.gmail.com", "<username>", "password");
System.out.println(store);
Folder inbox = store.getFolder("Inbox");
inbox.open(Folder.READ_ONLY);
Message messages[] = inbox.getMessages();
for(Message message:messages) {
System.out.println(message);
}
i want to know the logic of writing a java program for the string in triangular form.
For example 'my name is sushma' is a string i have write java program to display the name in triangular form.
hi sir
i have written the program saving it with the same class name n when i am executing it is showing unable to read the file . what should i have to do ?
Create an abstract class with no methods. Derive a class and add a method. Create
a static method that takes a reference to the base class, downcasts it to the derived
class, and calls the method. In main( ), demonstrate that it works. Now put the
abstract declaration for the method in the base class, thus eliminating the need for
the downcast.
Actually I really watend to make Phage Wars 2 Multiplayer but I didn't have the means to host a server. In the end I decided to focus on features instead of multiplayer.I would really like to revisit this game and add more RTS features as I think the Flash Industry needs a few more RTS games. I've done Multiplayer games in the past and this game gets more requests for multiplayer than any other. I definitely want to add a third but I think I will have to wait until Multiplayer is more of a possibility before doing so.
xjrSitQTlZSinrahenrianto January 19, 2013 at 4:07 PM
above i think multi-player phage wars would be the best yet. although if you do make a phage wars 3 and it doesn't have multi-player i think the next best thing you could do would be to make a story line. seiothmng like an experimental drug has been injected into a human host and now has to take it over while combating obstacles like while blood cells and the lymph nodes and such. not THAT would make my day, but ether way you make some amazing games keep up the great work. also i think it would be cool to see like a player created map pack of demolition city, or more maps or seiothmng. that's a pretty fun game as well.
I am an engineering student of 3rd year.
I am preaparing for java from next 2 semesters,I desided that I only prepare for java nothing else so it is good for me as java provide me aportunities in feture for jobs & if provides so what they are & in whose sector........
I need help in writing this. If anyone can help that would be appreciated.
Implement a Singly Linked List in Java. Use this program to develop the following application. This application accepts from console and stores a list of 10 names of your friends in the Singly Linked List. The order of arrival of these names determines the sequence of names in the linked list. Implement a method that sorts the original sequence into a new sequence based on the alphabetical order of the names.
how i can create a sms server in java that sends sms from a java desktop application to mobile phone using via a usb cable connction in mobile or messaging by bluetooth
1. write a program that reads a number greater than or equal to 1000 from the user and prints it out with a comma separating the thousands.
2. then the reverse of it..
please i need it tommorow of a day after tommorow
Hi There,
I have completed my Engineering last year and I am very interested in becoming an Android Developer. I understand that for this I have to start with JAVA developors course which I was able to browse through your site. Can you send me more info on this course and the future prospects on getting into Android development.
I would appreciate if you could let me knwo the training costs and also when the fresh batch starts.
Thanks and I hope for an early response from you.
Regards,
Aadil Khan
Hi, i really need somebody help help. i have tried so hard to program it but i just cant do it.
model a student object.
The student object has the following attributes:
First_name, Last_name, Student_Id. // ways to identify each student
4 subjects and each subject will hold 10 marks
Subject_one, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9
Subject_two, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9
Subject_three, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9
Subject_four, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9
Your methods for the student class must include but are not limited to:
Get_first_name, Get_last_name, Get_Student_Id. // will print or return the data.
Get_Subject_1, Get_Subject_2, Get_Subject_3, Get_Subject_4.
Display_Subject_1, Display _Subject_2, Display _Subject_3, Display _Subject_4.
Get_Subject_mark[specific mark] //will display the specified mark.
Get_Subject_all_marks // will display all 10 marks and the subject name.
Get_overall_average, // will get the average for all 40 marks.
Get_Subject_average// will get the average for any 1 subject.
Im Unable to find all interfaces and classes of java through command prompt..
can any one, pls help me in tracing out..
i tried to type javap java.lang.* but it doesnt work.im able to see only methods in a class,,but how can i get intrfaces and classes..??
Words in English are separated by delimiters such as colon (:), semi-colon (;), fullstop(.), question mark(?), space( ), hyphen(-), new line(\n), exclamation(!) and comma(,).
In this problem, a java class MyDocument is present that has a method:
Method 1: alphabetOccurrence (), counts number of occurrence of an alphabet.
The Main Class demonstrates the use of MyDocument class.
I need code to implement the below method:
1. alphabetOccurrence ()
Complete Program:
import java.util.*;
class Main {
public static void main(String[] args)
{
MyDocument document = null;
String text;
text = "good morning. Good morning Alexander. How many people are there in your country? Do all of them have big houses, big cars? Do all of them eat good food?" ;
char letter = 'd';
document = new MyDocument();
document.setDocumentText(text);
System.out.println("Letter " + letter + " has occured " + document.alphabetOccurrence(letter) + " times");
}
}
class MyDocument {
private ArrayList<Character> document = new ArrayList();
public MyDocument()
{
}
void setDocumentText(String s)
{
for(int i = 0; i < s.length(); i++)
document.add(s.charAt(i));
}
ArrayList getDocumentText()
{
return this.document;
}
public int alphabetOccurrence(char letter){
return 0;
}
}
Sir,
I am in need to install into my lap top vide which I may be able to upload the tenders of various contractors on the site e-tenders.hry.nic.in for the works related to Haryana Irrigation Department.
Thanks
hiiiiiiiiii
My project is spend analysis.
how to connect one page to another page ?
like my 1st page is employee detail &there are one button ,when i click this button the next page page.
I have downloaded a project on library management system in core java and it is also working but it is not connecting with database which is with jdbc and odbc. An exception is coming which is java.sql.SQLException:[Microsoft][ODBC Driver Manager] The specified DNS contains an architecture mismatch between the Driver and Application
Hi, please i need some help to write code about binary search tree to do this :
print the lowest common ancestor between two nodes V and W, it can be defined as the lowest node T that has V and W as descendants.(public static void printLCA(int x,int y) )
I did the coding to create a pie chart file in png format file,
the pie chart shows the percentage but in the bottom of the file,
I want the percentage to appear in the chart itself,
This is the codes I have used,
String query = "SELECT name,flag from mawarid";
JDBCPieDataset dataset = new JDBCPieDataset(
"jdbc:oracle:thin:@ 127.0.0.1:1521:XE", "oracle.jdbc.OracleDriver",
"", "");
dataset.executeQuery(query);
JFreeChart chart = ChartFactory.createPieChart("Test", dataset, true,
true, false);
try{
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}"));
final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
final File file1 = new File("Chart5.png");
ChartUtilities.saveChartAsPNG(file1, chart,600 , 400,info);
}
catch(Exception e)
{
}
when give the error following the code:
public class AddPersonPanel extends JFrame implements ActionListener{}
This error is: package name.class name is not abstract & does not override abstract method actionPerformed
First of all the idea of the Hoplink, while brilliant, is fundamentally flawed. It fails to take into account of the fact that we as humans, are generally unable to remember large strings of meaningless letters and numbers. If you which to successfully send a link to a prospect, I advise you to use a proper website address and set that address to auto redirect. Not only will it be instantly more memorable but also inspires a far higher degree of confidence in people viewing your link.
Hai,
Am using your website to learn java. but i want to download the full collection of your tutorial.. Is its possible to download your full collection of tutorials.. if possible, how can i download the tutorials?...
I'm not as big of fan of Rosetta Stone as many people here. Unforgettable Languages did the trick for me, I saw them on NBC nhlgtiy news one night and got their Italian online course, they use a scientific memory method called Linkword and TRUST me it worked well for this dumb Southerner! Oh and they tout themselves as being the fastest way to learn ANY Language think they are cheaper than Rosetta tooHere is the French Free Demo and Information LinkHere is the Spanish Free Demo and Information LinkGood Luck
hai can any one help me ?
task :
To define a function which looks like my_func(input_db, output_directory).
it has to be robust and:
Check if there are any matching NS**** or T**** files existing.
Only for those files the function has to be executed!
All results
should be stored inside a user-definable directory. The function should print out how many data sets
were found and how many data sets were processed.
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running?
Instruction:
Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates
Code:
import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running?
Instruction:
Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates
Code:
import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running?
Instruction:
Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates
Code:
import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running?
Instruction:
Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates
Code:
import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
Hi good morning,
As I installed Apache Tomcat 5.5 in windows server(Admin).
Now the problem is that only one user can run a program on tomcat server at a time, that multi users not able to run a program simultaneously.
Please give some solution to above problem ASAP.
Thanks you in advance.
Kind Regards,
Shivashankar
1. Implement the Queue class using java collection classes.
2. The following methods must be implemented.
public void enqueue(Object o);
public Object dequeue();
public Object front();
public boolean isEmpty();
public void clear();
3. Name you file Queue.java.
/* for our latest activity...im having a tough problem
public class staticc{
int i;
static int j;
public static void staticMethod(){
System.out.println("you can access a static method this way");
}
public void nonStaticMethod(){
i=100;
j=1000;
System.out.println("Don't try to access a non static method");
}
public static void main(String[] args) {
//i=100;
j=1000;
//nonStaticMethod();
staticMethod();
}
}
i have previously saved riht programs,i have installed the jdk1.5 and set te path again and tried to run those programs by command promt.it was compiled successfully ,but on running it given an exception-exception in thread main-no classDefFounnd! ,plz guide me about it,the attempt of running it on netbeans has also failed.
I'm not to sure on how to create a GUI's in java and i'm wondering if you could help also I tried to create two new classes but I can not get them to run properly no matter what i do here is my code:
package carrental;
import java.util.*;
import java.util.Scanner;
class Res {
private String name;
private int num;
// private String make;
// private String model;
// private String regNo;
private Car reservecar;
private int deposit;
private int rate;
Res(String name, int num, String model, String regNo, int days, int cost) {
}
public String getName() {
return name;
}
public int getNum() {
return num;
}
}
class Car {
private String make;
public String model;
private String regNo;
private int deposit;
private int rate;
public Car(String newMake, String newModel, String newRegNo,
int newDeposit, int newRate) {
make = newMake;
model = newModel;
regNo = newRegNo;
deposit = newDeposit;
rate = newRate;
}
public String getMake() {
return make;
}
public String getModel() {
return model;
}
public String getRegNo() {
return regNo;
}
public int getDeposit() {
return deposit;
}
public int getRate() {
return rate;
}
}
public class Main {
public static void main(String[] args) {
ArrayList<Res> reservelist = new ArrayList<Res>();
ArrayList<Car> carlist = new ArrayList<Car>();
Scanner input = new Scanner(System.in);
carlist.add(new Car("Toyota", "Altis", "SJC2456X", 100, 60));
carlist.add(new Car("Toyota", "Vios", "SJG9523B", 100, 50));
carlist.add(new Car("Nissan", "Latio", "SJB7412B", 100, 50));
carlist.add(new Car("Murano", "Nissan", "SJC8761M", 300, 150));
carlist.add(new Car("Honda", "Jazz", "SJB4875N", 100, 60));
carlist.add(new Car("Honda", "Civic", "SJD73269C", 120, 70));
carlist.add(new Car("Honda", "Stream", "SJL5169J", 120, 70));
carlist.add(new Car("Honda", "Odyssey", "SJB3468E", 200, 150));
carlist.add(new Car("Subaru", "WRX", "SJB8234L", 300, 200));
carlist.add(new Car("Subaru", "Imprezza", "SJE8234K", 150, 80));
int num;
System.out.println();
do
{
System.out.println("\t1. Make Reservation. ");
System.out.println("\t2. Delete Reservation.");
System.out.println("\t3. Review Reservations.");
System.out.println("\t4. Quit.");
System.out.println();
num = input.nextInt();
switch(num)
{
case 1: Make(carlist, reservelist);
break;
case 2: Delete(carlist, reservelist);
break;
case 3: Review(carlist, reservelist);
break;
case 4:System.out.println("Thank you for using this program.");
break;
default: System.out.println(" Please follow directions\n"
+ " 1 Make Reservation. \n"
+ " 2 Delete Reservation.\n"
+ " 3 Review Reservations. \n"
);
}
}while(num != 4);
}
public static void Make(ArrayList<Car> carlist, ArrayList<Res> reservelist) {
String name = null;
int num = 0;
Scanner input = new Scanner(System.in);
System.out.print("Enter model to rent: ");
String model = input.nextLine();
for (Car s : carlist) {
if (model.equals(s.getModel())) {
System.out.println("Model " + model + " is available");
System.out.print("Enter number of days: ");
int days = input.nextInt();
System.out.println("****Details****");
int cost = days * s.getRate() + s.getDeposit();
System.out.println("Deposit DailyRate Duration TotalCost");
System.out.println(s.getDeposit() + " " + s.getRate()+ " " + days + " " + cost);
System.out.print("Proceed to rent?( y/n ): ");
String dec = input.next();
if (dec.equals("y")) {
System.out.println("Enter Customer Name: ");
name = input.next();
System.out.println("Enter IC Number: ");
num = input.nextInt();
System.out.println("***Receipt****");
System.out.println("Name ICNo Car RegNo Duration TCost");
System.out.println(name + " " + num + " " + model + " " + s.getRegNo() + " " + days + " "+cost);
reservelist.add(new Res(name, num, model, s.getRegNo(), days, cost));
System.out.println("Serving Next Customer ");
}
else if (dec.equals("n")) {
System.out.println("Serving Next Customer: ");
}
}
/* if ( carlist.remove(s)) {
System.out.println(" Car not available");*/
}
}
//Delete reservation made
public static void Delete(ArrayList<Car> carlist, ArrayList<Res> reservelist) {
Scanner input = new Scanner(System.in);
System.out.print("Enter name on reservation: ");
String name = input.nextLine();
for(Res f : reservelist) {
if(name.equals(f.getName())) {
System.out.println(f);
}
}
}
//review list of reservations
public static void Review(ArrayList<Car> carlist, ArrayList<Res> reservelist) {
System.out.println(reservelist.size());
}
}
Write a program that creates a text file that contains a power of two table in HTML format. The file could be called "twoPowerTable.html". When it is viewed with a browser you will see something like:
Power of 2 Value
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
The file should start with something like:
<html><head>
<title>Powers of Two</title>
</head>
<body>
<table border cellpadding=5>
<tr><th>Power of 2</th><th>Value</th></tr>
And end with:
</table>
</body></html>
Each line of the table looks like:
<tr><td>0</td><td>1</td></tr>
some help in programmingswati shriwastav April 5, 2011 at 7:05 PM
i've a program in library management its GUI is running but the connectivity with MS-access is not getting done. please help me as soon as possible. Here is the code
how i run this program error??? joydeep April 8, 2011 at 5:49 PM
package Student; // public class Person // { // int age; // String name; // public Person() // { // age=0; // name=""; // } // public void getPersonDetail(int newAge,String newName) // { // age=newAge; // name=newName; // } // public void putPersonDetail() // { // System.out.println("Name:"+name); // System.out.println("Age:"+age); // } // } // public interface Sports // { // public final int point=2; // public void putPoint(); // } // public class Stud extends Person implements Sports // { // int rollno; // String dept; // public Stud() // { // rollno=0; // dept=""; // } // public void getStudentDetails(int newNo, String newName,int newAge,String newDept) // { // getPersonDetail(newAge,newName); // rollno=newNo; // dept=newDept; // } // public void putStudentDetails() // { // putPersonDetail(); // System.out.println("Roll No"+rollno); // System.out.println("Department:"+dept); // putPoint(); // } // public void putPoint() // { // System.out.println("Point:"+point); // } // } // import Student.*; // class StudentDemo // { // public static void main(String args[]) // { // stud newStudent=new Stud(); // newStudent.getStudentDetail(101,"JOYDEEP",66,"JAVA"); // newStudent.putStudentDetail(); // } // }
j2se,j2eegaurav kumar rajawat April 9, 2011 at 10:50 AM
j2se is most programing langauge
access to a remote machine using IP adresseRaSdab April 16, 2011 at 5:05 PM
hi all,i want to access to a remote machine using it's ip adress to recover some information of computrs like (os,ip adresse,mac adress,list of installed software,....). i I managed to recover those information but in a localhost i need your help to do that for a remote machine using java. thikks for your comments. :)
Regarding RMIParikshit Kansara April 20, 2011 at 7:32 PM
hi,I am working on Traveling Tournament problem project.I have already implemented this project in java. running on single system.I want implement this project in distributed environment and how i can implement this using RMI??
javaraju April 21, 2011 at 12:10 PM
java question
Corporate Java TrainingJava Training April 23, 2011 at 11:28 PM
thank's for info java is strong software language..
javaYogesh April 25, 2011 at 11:12 AM
how to use Applet in our class
javayogesh April 25, 2011 at 11:14 AM
how to add shortct in menuitem
information technologyHariom raval May 23, 2011 at 8:43 PM
i wnt learn what is it
want java trainingkhan abdul kalam`` May 23, 2011 at 10:11 PM
just mail or contact me abt the java training
core javaIrfan Ahmed May 25, 2011 at 4:55 PM
How do i change background color of jLabel in swings on mouse moved and mouse out.
Java Programmanish May 26, 2011 at 7:07 PM
Create a program that represents deck of cards using object oriented approaches. Provide typical functions for utilizing a card deck.
Swing and access to remote databasesyed May 28, 2011 at 4:48 AM
Hello, I want to develop a Swing database application that uses database at remote location. Please help me to develop this. It should work similar to a J2EE application. Instead of using in browser, this should run like ordinary desktop application. what are the technology to be used?.
J2EEkavita May 28, 2011 at 3:28 PM
pLZ U provide d notes of J2EE at my email id. Thanks& regarda kavita
JavaSaurabh Parikh May 30, 2011 at 10:41 AM
Needed your contact details for Sun Java courses in Ahmedabad. Regards Saurabh
javasrilekha May 31, 2011 at 8:54 PM
sir,i need to know the procedure to apply for scja and scjp exams?
java mouseeventsram June 1, 2011 at 7:57 PM
want code when mouse moves onto a image then we should get a checkbox type where we should have the information of the image
java vikki June 2, 2011 at 10:55 PM
hi I am vikki from new delhi and I am preparin scjp&scwcd exam
javajagath prabhu.n June 7, 2011 at 4:41 PM
about java
abt notesshumayla mirza June 4, 2011 at 5:45 PM
nice notes but something more should be....
java kanchan June 7, 2011 at 11:52 PM
nice style of teaching.Thanks. I want to know about the procedure of downloading this.
for loopDUMINDA June 10, 2011 at 8:40 PM
its important 4 me
java script programsue June 15, 2011 at 1:07 AM
The program will input Data of Salesman Id, Item code, and number of cuestomer. Sales id is 5digit long, and items code range from 100-300 if Item code is 100-150, display " aim high" if item code is 150-200, display "good sales" if item code is 250-300, display "excellent sales" each customer should not purchase 3 items at once final report should produce folling summary Salesman ID Item code no of customers 12356 100 1 45678 112 2 kindly advise
about core javajanardhan putta June 18, 2011 at 8:51 PM
send me about core java clearly
thanksnaresh June 18, 2011 at 11:05 PM
it very helpful for me thanks a lot sir
java projectvandana anghan June 20, 2011 at 10:54 AM
hello, i want to do project in java.Can i do my project on anti-virus engine? please guide me.
javavishvambhar June 21, 2011 at 7:35 PM
how to create animation in core java
wla lngbhea June 22, 2011 at 9:21 AM
nice tutorial in java lectures and cdes!!!
ndi murwa wa ha TshirangwanaMoosa June 24, 2011 at 3:30 PM
iwould like to know more
JAVA , the competing language.Karthik(HYDERABAD, INDIA) June 25, 2011 at 1:46 AM
I love this website . I request this site to present Java with simple examples in order of precedence of chapters.
javasantosh June 25, 2011 at 9:10 PM
it z good if u give in detail
Asking codeGaurav June 26, 2011 at 2:07 PM
I wants to know what is the code of sun medical dictionary and what is the cost of purchasing it
javauday July 11, 2011 at 7:45 AM
where we have to place the source code as part of your project?
JavaN.Priyadharsini June 30, 2011 at 2:09 PM
Good
javashaik Abdullla July 1, 2011 at 12:22 AM
very nice & useful
question about in javaR.senthil kumar July 2, 2011 at 2:00 PM
//what is a output if error accured what is the reason class a { public static void main(String args[]) { byte a=10; byte b=10; byte c=a+b; System.out.println(c); } }
javarosh July 2, 2011 at 2:56 PM
what is d/f b/w assertion & exception
thankskavita gupta July 2, 2011 at 9:15 PM
i like this website.
javaVergin sheeba September 17, 2011 at 7:44 AM
This java tutorials is very use full to the students
javadlarej September 20, 2011 at 5:31 PM
,nice web
java languageBIDYUT DALAL September 21, 2011 at 12:36 PM
add two number without classs
is void type is fixed for main() in java???piyush September 25, 2011 at 9:31 PM
public static int main(String[] args) is this right(above) instead of public static void main(String args[])..
j2ee tutorialssanoj September 27, 2011 at 12:49 PM
great
Help in understanding the flow of learning.sukhendu rana September 29, 2011 at 7:04 PM
Sir/Madam, I am very keen to learn Java. Although your website has helped me emmensly with the 'New to Java' section, I want to learn further and slowly get expertise with the help of your website. Hence, I would like to know the process/flow to learn Java. I am getting confused with so many links. Could you please provide me the step by step links/Tutorials which I should follow in order to become a Java/J2EE professional. Any help would be greatly appreciated. Thank you. Sukhendu.
jquestion about javaasma October 2, 2011 at 8:43 PM
how to write one simple java program that will open any three programs at the same time ?
Object-Oriented ProgrammingGemma Delos Santos October 3, 2011 at 2:54 PM
., It's difficult to program .,
DeploymentRohit VAiragkar October 4, 2011 at 10:01 AM
How to deploy a .java file? I don't want to deploy on a server,only to a single machine.
featuresvaibhav October 5, 2011 at 6:20 PM
great knowledge of java featuers in this site
java coremayank rajpoot February 20, 2013 at 1:54 AM
this solution i am stisff
java tutorialOrtega October 19, 2011 at 12:42 PM
write a java application for a video club that must do the following; 1)register new members 2)register new videos 3)be able to rent out or borrow videos 4)search videos from the database
Java Basicssanthu October 22, 2011 at 12:20 AM
Please send me Advanced Java Concepts. Thanks in Advance.
want some detais about javasudhakar October 22, 2011 at 4:32 PM
some details
HiStop 0x00000124 October 24, 2011 at 4:08 PM
Great tutorial i really learn a lot of things from this blog. Thanks for sharing
one questionpomma January 29, 2013 at 5:02 AM
list the difference between extend and implements keywords>example program
project on university student managment systemtariku adam November 1, 2011 at 12:51 PM
i want aid,than u.
ITdungar mal November 2, 2011 at 4:04 PM
wants download
what i interface?ravi November 8, 2011 at 11:55 PM
send me answer
javasathyam November 10, 2011 at 4:47 PM
this web site imprves the knowldge through the communication with diff person
Passing inputs to a jar file through a fileSeshu February 23, 2013 at 3:50 PM
Hi i've Jar file which runs successfully with built in inputs. But i want to give inputs to the jar file through a file..can anyone explain?
doubt in ASCII Surya Krishna Bharath November 16, 2011 at 1:04 PM
hi sir/madam i need your information that when 9 is char then it's ASCII is "57" is it posible to find that what is the ASCII value for "99"as a char. sorry sir i am not able ask correctly what my doubt was ,so please excuse me and send me replay
javajyotsna November 17, 2011 at 4:31 PM
Iwant to learn adv java nad some topics in core java
all the programs of java with their outputsswati panth November 19, 2011 at 4:47 PM
program should not be complicated. Easy to understand
About javaAryan Raj November 23, 2011 at 1:03 PM
Actually i am very impresed to online java tutorials
Help in writing a programLaura November 24, 2011 at 3:28 AM
I am just wondering how to write a program that finds the first palindromic prime number above 100,000 and i have to Include the value of this prime in a comment at the start of the code.
computerRaghav Dang November 24, 2011 at 9:27 AM
cool
javaVasuneet November 24, 2011 at 9:29 AM
just lovely :P
Javajitender November 24, 2011 at 12:49 PM
It's good
Java netbeansKrish November 26, 2011 at 1:22 PM
I'm a student of grade 9 and i hope this site will help me learn Java
nice PostDeepak November 28, 2011 at 12:01 AM
Nice work guys. www.de-tutorials.com
javapavan November 28, 2011 at 3:55 PM
it is good
ssrudrasivaprasad December 1, 2011 at 2:51 PM
give more programming examples with simple logic
subrudrasivaprasad December 1, 2011 at 2:52 PM
plz give easy examples to understood
project on email system in java pradeep karanjule December 2, 2011 at 3:37 PM
what is mean the jsp servlet and how we convert jsp files into php and java
j2eeramuk December 9, 2011 at 8:12 AM
Patient patientobj=new Patient() ; Patient patientobj1=new Patient(); Patient_dao patientdaoobj=new Patient_dao(); String name=request.getParameter("patientname"); String disease=request.getParameter("diseasename"); int wardNo=Integer.parseInt(request.getParameter("wardnumber")); patientobj.setPatientname(name); patientobj.setDiseasename(disease); patientobj.setWardnumber(wardNo); patientdaoobj.insert(patientobj); ArrayList list =patientdaoobj.view(patientobj1); request.setAttribute("data",list); RequestDispatcher rd=request.getRequestDispatcher("/view.jsp"); rd.forward(request,response);
what is java mail....naresh December 17, 2011 at 1:32 PM
pls ans
javaajay December 23, 2011 at 8:49 AM
Java is object
visul basic 6pratim December 28, 2011 at 11:25 PM
How to give connection to MS access database to disply name in text boxes from database
help meqaseh January 4, 2012 at 12:53 PM
you are required to develop a simulation program on array-based list. The array can store up to maximum ten integer or string values.The application should be able to perform basic operations such as inserting,deleting and displaying the array's content. any extra operations are welcome.The application should prompt user a menu. you are free to perform either forward or backward approach for inserting process.for deleting purposes remove the most front element in the list.
javajaya January 4, 2012 at 4:39 PM
java is advanced program
javacaptainportal January 9, 2012 at 4:33 PM
good site
thanks for java desinging teamgowri sankar January 12, 2012 at 12:52 PM
hi team i am learning java language... very useful this website tank you
Stella January 15, 2013 at 10:18 PM
could you please send the C-pgrm code for the mirror image of floyd's triangle
c-pgrm code Stella January 15, 2013 at 10:21 PM
could you please send the C-pgrm code for the mirror image of floyd's triangle
java syllabusvinitha vasudevan January 13, 2012 at 6:35 PM
get me a latest programs in it
Final Publication Certificatekundan kumar January 17, 2012 at 3:59 PM
i want to java developer
how to update?harish.k January 17, 2012 at 10:58 PM
package com.tcs.ilp.usermanagement.DAO; import java.sql.Connection; import java.sql.Statement; import com.tcs.ilp.usermanagement.bean.StudentViewBean; import com.tcs.ilp.usermanagement.connection.ConnectionManager; /** * StudentUpdateDAO * @author 539064 * */ public class StudentUpdateDAO { static Connection currentCon = null; public static StudentViewBean update(StudentViewBean bean) { //preparing some objects for connection Statement stmt = null; String email = bean.getEmail(); String address=bean.getAddress(); String mobileno=bean.getMobileno(); String username=bean.getUsername(); System.out.println(username); String s ="update student set email='"+email+"',address='"+address+"',mobileno='"+mobileno+"' where username='"+username+"'"; // "System.out.println" prints in the console; Normally used to trace the process try { //connect to DB currentCon = ConnectionManager.getConnection(); stmt=currentCon.createStatement(); stmt.executeQuery(s); stmt.executeQuery("commit"); bean.setValid(true); } catch (Exception ex) { System.out.println("update failed: An Exception has occurred! " + ex); } //some exception handling finally { if (stmt != null) { try { stmt.close(); } catch (Exception e) {} stmt = null; } if (currentCon != null) { try { currentCon.close(); } catch (Exception e) { } currentCon = null; } } return bean; } }
javamail helpSandesh January 18, 2012 at 6:40 PM
Hello experts, i am trying to read mail from gmail, which is working perfectly in the local machine. but when I update the server i am getting the following error . javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed outfalse The Code i am using is : Session session = Session.getDefaultInstance(props, null); Store store = session.getStore("imaps"); store.connect("imap.gmail.com", "<username>", "password"); System.out.println(store); Folder inbox = store.getFolder("Inbox"); inbox.open(Folder.READ_ONLY); Message messages[] = inbox.getMessages(); for(Message message:messages) { System.out.println(message); }
surendersurender January 19, 2012 at 5:05 PM
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> <html> <head> <title>UIViewRoot</title> </head> <body bgcolor="#ffffff"> <h1>UIViewRoot example</h1> <f:view> <h:outputLabel for="validatorInput"> <h:outputText value="Enter text:"/> </h:outputLabel> <h:inputText id="myOtherInput"> <f:validateLength minimum="0" maximum="3"/> <f:validateLongRange minimum="1" maximum="100"/> </h:inputText> <h:message for="myOtherInput" showDetail="true" showSummary="true" warnStyle="color: green" infoStyle="color: blue" errorStyle="color: red"/> <br><br> <h:panelGroup id="myGroup" styleClass="table-background"> <h:graphicImage url="images/hello.gif"/> <h:outputText value="Column 1"/> <h:outputText value="Column 2"/> </h:panelGroup> <h:panelGrid columns="3" cellpadding="1" border="1" width="40%"> <h:outputText value="(1,1)"/> <h:outputText value="(1,2)"/> <h:outputText value="(1,3)"/> <h:outputText value="(2,1)"/> <h:outputText value="(2,2)"/> <h:outputText value="(2,3)"/> </h:panelGrid> <h:panelGrid columns="4" styleClass="table-background" headerClass="page-header" columnClasses="table-odd-column, table-even-column" footerClass="table-footer" cellpadding="1" border="1" width="40%"> <f:facet name="header"> <h:panelGroup> <h:outputText value="This is a sample header."/> </h:panelGroup> </f:facet> <h:outputText value="(1,1)"/> <h:outputText value="(1,2)"/> <h:outputText value="(1,3)"/> <h:outputText value="(1,4)"/> <h:outputText value="(2,1)"/> <h:outputText value="(2,2)"/> <h:outputText value="(2,3)"/> <h:outputText value="(2,4)"/> <h:outputText value="(3,1)"/> <h:outputText value="(3,2)"/> <h:outputText value="(3,3)"/> <h:outputText value="(3,4)"/> <f:facet name="footer"> <h:outputText value="This is the footer."/> </f:facet> </h:panelGrid> </f:view> </body> </html>
java referanceBal pawar January 20, 2012 at 12:11 PM
i want to lear java technologies withen one month it is possible?
Java using MS WordJayapal ReddyM January 21, 2012 at 10:26 AM
Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Java using MS WordJayapal ReddyM January 21, 2012 at 10:28 AM
Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Java using MS WordJayapal ReddyM January 21, 2012 at 10:30 AM
Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
Java using MS WordJayapal ReddyM January 21, 2012 at 10:31 AM
Is it possible to develop java code using MS Word, if possible what are necessary settings required in MS Word Editior
databaseNaresh January 21, 2012 at 11:31 AM
how to retrieve the table data in oracle using core java fundamentals
Adding a sound file to a java appletBernard Clark January 22, 2012 at 8:13 AM
I tried to post a question about adding a sound file to an applet, tried to send the program but couldn't seem to get past the sign in page
Java program to write string in triangular form.Sushma January 26, 2012 at 2:14 AM
i want to know the logic of writing a java program for the string in triangular form. For example 'my name is sushma' is a string i have write java program to display the name in triangular form.
java save n complation p satish January 26, 2012 at 7:34 PM
hi sir i have written the program saving it with the same class name n when i am executing it is showing unable to read the file . what should i have to do ?
vYcuSMKlSHpyTyya January 19, 2013 at 2:07 AM
That's an inegnoius way of thinking about it.
i want coding with outputRAJESH January 31, 2012 at 7:44 AM
How to create the login and password in java programming?
i want coding with outputRAJESH January 31, 2012 at 7:50 AM
how to learn swing components with example and output?
i want coding with outputRAJESH January 31, 2012 at 7:53 AM
FRIENDLY FUNCTION PROGRAM WITH OUTPUT
java programmingrukmangad January 31, 2012 at 12:06 PM
java language is very popular.
java Exampleabhay singh February 1, 2012 at 12:18 PM
Project Code Java Example Codes
java stringlengthGanesh Rahinj January 11, 2013 at 2:45 PM
import java.lang.*; import java.io.*; class StringLength { public static void main(String[] args) throws IOException { System.out.println("String lenght example!"); BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); System.out.println("Please enter string:"); String str = bf.readLine(); int len = str.length(); System.out.println("String lenght : " + len); } }
javakalel rahuman February 6, 2012 at 6:21 PM
no cmd
Java - downcastingJayapal Reddy February 7, 2012 at 1:43 PM
Create an abstract class with no methods. Derive a class and add a method. Create a static method that takes a reference to the base class, downcasts it to the derived class, and calls the method. In main( ), demonstrate that it works. Now put the abstract declaration for the method in the base class, thus eliminating the need for the downcast.
java developer..thanush.m February 10, 2012 at 1:31 PM
simple program my mail send,, me,,, friend...
thank uR.devipriya January 19, 2013 at 1:27 PM
need java full package from the basics i kindly request you to send mail to the above email id... from this i like to learn java fully
afvNwkFPsjiLucas January 19, 2013 at 6:23 PM
Actually I really watend to make Phage Wars 2 Multiplayer but I didn't have the means to host a server. In the end I decided to focus on features instead of multiplayer.I would really like to revisit this game and add more RTS features as I think the Flash Industry needs a few more RTS games. I've done Multiplayer games in the past and this game gets more requests for multiplayer than any other. I definitely want to add a third but I think I will have to wait until Multiplayer is more of a possibility before doing so.
xjrSitQTlZSinrahenrianto January 19, 2013 at 4:07 PM
above i think multi-player phage wars would be the best yet. although if you do make a phage wars 3 and it doesn't have multi-player i think the next best thing you could do would be to make a story line. seiothmng like an experimental drug has been injected into a human host and now has to take it over while combating obstacles like while blood cells and the lymph nodes and such. not THAT would make my day, but ether way you make some amazing games keep up the great work. also i think it would be cool to see like a player created map pack of demolition city, or more maps or seiothmng. that's a pretty fun game as well.
Core javaSHIKHA February 12, 2012 at 1:35 AM
i have gone through then the tutorial of java and i felt that it is very much beneficial for the students who are beginning to study core java.
about c &c++shikha February 12, 2012 at 1:39 AM
thanku for providing help but i want tto know that can u help us in c&c++ by providing such tutorials. if u can do this theni m very thankful to u.
javajelani basha February 14, 2012 at 11:05 AM
what is the difference between an abstract class and interface
about java language in industriesgourav patil February 14, 2012 at 12:19 PM
I am an engineering student of 3rd year. I am preaparing for java from next 2 semesters,I desided that I only prepare for java nothing else so it is good for me as java provide me aportunities in feture for jobs & if provides so what they are & in whose sector........
online registration Krishna February 16, 2012 at 3:07 PM
Hi, i want to register for your different course provided online. kindly let me know how can i register and access the course. Regards, Krishna
Need help Sharan February 22, 2012 at 8:00 AM
I need help in writing this. If anyone can help that would be appreciated. Implement a Singly Linked List in Java. Use this program to develop the following application. This application accepts from console and stores a list of 10 names of your friends in the Singly Linked List. The order of arrival of these names determines the sequence of names in the linked list. Implement a method that sorts the original sequence into a new sequence based on the alphabetical order of the names.
javamohan February 28, 2012 at 2:29 PM
java
sms servershabeer March 8, 2012 at 4:50 PM
how i can create a sms server in java that sends sms from a java desktop application to mobile phone using via a usb cable connction in mobile or messaging by bluetooth
java conceptsswetha March 10, 2012 at 2:19 PM
good
ThanksAlexwhite March 10, 2012 at 7:19 PM
Thanks for such nice tutorials. Helped me alot.
Java ProgrammingNiko Neal Farinas March 12, 2012 at 11:10 AM
1. write a program that reads a number greater than or equal to 1000 from the user and prints it out with a comma separating the thousands. 2. then the reverse of it.. please i need it tommorow of a day after tommorow
JAVA Training Aadil Khan March 14, 2012 at 2:07 AM
Hi There, I have completed my Engineering last year and I am very interested in becoming an Android Developer. I understand that for this I have to start with JAVA developors course which I was able to browse through your site. Can you send me more info on this course and the future prospects on getting into Android development. I would appreciate if you could let me knwo the training costs and also when the fresh batch starts. Thanks and I hope for an early response from you. Regards, Aadil Khan
javaSuresh March 14, 2012 at 1:00 PM
nice tutorial
javaBhavya March 14, 2012 at 2:48 PM
nice one
about java,web,html,selin simon March 15, 2012 at 2:42 PM
describe with example this all thing.
JAVA DEVELOPER NEEDS.sushmita shukla March 17, 2012 at 3:58 PM
what must be a java developer need? requirements to become java developer?
javaK.Aswani March 20, 2012 at 12:14 PM
This site is Excellent in learning.
javajayesh March 21, 2012 at 2:03 PM
any
Java Help! Rita March 23, 2012 at 12:06 AM
Hi, i really need somebody help help. i have tried so hard to program it but i just cant do it. model a student object. The student object has the following attributes: First_name, Last_name, Student_Id. // ways to identify each student 4 subjects and each subject will hold 10 marks Subject_one, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_two, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_three, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Subject_four, mark0,mark1, mark2, mark3,mark4,mark5,mark6,mark7,mark8,mark9 Your methods for the student class must include but are not limited to: Get_first_name, Get_last_name, Get_Student_Id. // will print or return the data. Get_Subject_1, Get_Subject_2, Get_Subject_3, Get_Subject_4. Display_Subject_1, Display _Subject_2, Display _Subject_3, Display _Subject_4. Get_Subject_mark[specific mark] //will display the specified mark. Get_Subject_all_marks // will display all 10 marks and the subject name. Get_overall_average, // will get the average for all 40 marks. Get_Subject_average// will get the average for any 1 subject.
javathivja March 23, 2012 at 7:10 PM
good
javaagilan March 25, 2012 at 12:35 PM
i want project on college management system using java coding
Core java and Advanced javaImmi April 3, 2012 at 7:14 PM
is it possible to learn core and advance java in 2 months time at an NIIT centre 2-3 hrs a day / 6 days a week?
computer scienceluqman April 6, 2012 at 12:03 PM
it is a good way of learning
classes and interfaces in javaMounika April 6, 2012 at 4:17 PM
Im Unable to find all interfaces and classes of java through command prompt.. can any one, pls help me in tracing out.. i tried to type javap java.lang.* but it doesnt work.im able to see only methods in a class,,but how can i get intrfaces and classes..??
intrested in J2SE..J2EE.. and Networkingfarooq ahmed pirzado April 6, 2012 at 10:16 PM
this site is so good .. i like .. and help me more ...
Need Solution For Below Qn.Manoj Kumar Patel April 17, 2012 at 10:15 AM
Words in English are separated by delimiters such as colon (:), semi-colon (;), fullstop(.), question mark(?), space( ), hyphen(-), new line(\n), exclamation(!) and comma(,). In this problem, a java class MyDocument is present that has a method: Method 1: alphabetOccurrence (), counts number of occurrence of an alphabet. The Main Class demonstrates the use of MyDocument class. I need code to implement the below method: 1. alphabetOccurrence () Complete Program: import java.util.*; class Main { public static void main(String[] args) { MyDocument document = null; String text; text = "good morning. Good morning Alexander. How many people are there in your country? Do all of them have big houses, big cars? Do all of them eat good food?" ; char letter = 'd'; document = new MyDocument(); document.setDocumentText(text); System.out.println("Letter " + letter + " has occured " + document.alphabetOccurrence(letter) + " times"); } } class MyDocument { private ArrayList<Character> document = new ArrayList(); public MyDocument() { } void setDocumentText(String s) { for(int i = 0; i < s.length(); i++) document.add(s.charAt(i)); } ArrayList getDocumentText() { return this.document; } public int alphabetOccurrence(char letter){ return 0; } }
java shravankumar April 20, 2012 at 8:08 PM
i feel happy with this thank you.
About siteGopal Mohata April 21, 2012 at 10:40 AM
Rose India excellent site,My best site
JAVAPrincelin April 25, 2012 at 12:24 PM
Kindly send me the updates
To upload contractor's tenders through my LTMandeep Kumar Jain April 27, 2012 at 9:05 AM
Sir, I am in need to install into my lap top vide which I may be able to upload the tenders of various contractors on the site e-tenders.hry.nic.in for the works related to Haryana Irrigation Department. Thanks
about the details of projectsvrmurthy May 6, 2012 at 1:09 PM
sir,we r doing "students admission in colleges" project wat is the requirements of this project please mail to me sir...
change in input methodologynazia ali May 7, 2012 at 12:26 PM
plz give a discription along wid the programs so that beginners know that where are variables,.,.where are constructors,.,.etc etc,.,.
MCQmahesh May 10, 2012 at 3:18 PM
i think roseindia provide MCQ.......
java study need vidio fileGOVINDRAJ May 23, 2012 at 9:25 AM
i need vidio file basic java totorial
javaprakash June 12, 2012 at 11:48 AM
what is the difference between getActionCommand() and getSource()
to know about javajenish patel June 17, 2012 at 4:33 PM
hi, i am student of computer engg. i am in 1st year.i want to know that what is java??
How to print on dot matrix printer in Java.Shafi Chaudhry June 19, 2012 at 12:26 PM
Hello, I want to printed text on EPSON 300-ii printer, but do not know how? help me. Thanks
javasavitha June 20, 2012 at 11:26 AM
no comments
javaganga June 20, 2012 at 11:28 AM
no idea
spend analysispalak June 20, 2012 at 6:27 PM
hiiiiiiiiii My project is spend analysis. how to connect one page to another page ? like my 1st page is employee detail &there are one button ,when i click this button the next page page.
Java Jazz UpDeepak June 22, 2012 at 10:49 PM
Dear Authors, Is the magazine is no more getting published? It is a good learning resource.
drawing shapesfafa June 28, 2012 at 2:28 PM
I want a code for drawing several shapes with java
javaveenu June 29, 2012 at 12:18 PM
j2ee concepts
Java Or php projects for final year studentssandeep ghuge July 10, 2012 at 6:22 PM
hello, can anyone help me for a good java OR php project topic or sample projects, good websites ect. Thanks in advance.
online university management system projectroshan d vasava July 18, 2012 at 7:56 AM
Please give help of my project......
online universty management system Projectvasava rooshan July 18, 2012 at 8:00 AM
Pleas help of my project......
core javaakanksha agarwal July 19, 2012 at 4:05 PM
sir i want source code of online examination test.. m unable to get it.. so plz help me.. i hav 2 submit my project....
JavaG.Srinivasarao July 20, 2012 at 2:54 PM
to find the Sum of first natural numbers?
like it sajjad July 31, 2012 at 12:48 PM
the best site in field of java i get very nice info thanks................................
my qustionstephen August 1, 2012 at 1:35 PM
why using java programming
javaMohd Arshad August 4, 2012 at 1:49 PM
it's very helpfull.
java projectsarthak pandya August 6, 2012 at 9:04 AM
i am doing java project so how can i started with it
core javadinesh August 7, 2012 at 12:21 PM
matrix program
JavaDivya August 16, 2012 at 2:52 PM
Nice materials
about .jar filesjeevan August 21, 2012 at 12:45 PM
please put the .jar files and tell me how to create .jar file with meta-inf.
popopopo August 21, 2012 at 3:45 PM
import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class Main { public static void main(String[] args) { try { // Set cross-platform Java L&F (also called "Metal") UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (UnsupportedLookAndFeelException e) { // handle exception } catch (ClassNotFoundException e) { // handle exception } catch (InstantiationException e) { // handle exception } catch (IllegalAccessException e) { // handle exception } javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { new WellForm(); // Create and show the GUI. } }); } } ______________________________________________________________________________________________________________________- import java.awt.BasicStroke; import java.awt.Color; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import java.awt.color.CMMException; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.geom.Ellipse2D; import java.awt.geom.Line2D; import java.awt.geom.Rectangle2D; import java.text.DecimalFormat; import java.util.ArrayList; import javax.swing.JPanel; public class Canvas extends JPanel implements MouseMotionListener, MouseListener { private ArrayList<WellData> wellList; int selectIndex; Double valuesOfX[], valuesOfY[], propertyArray[]; int majorTics = 10, minorTics = 5; //double yTicsIncrValue = 0, xTicsIncrValue = 0; double height, width, leftInsect, bottomInsect; double pressX; double pressY; double releaseX; double releaseY; double draggedX; double draggedY; Graphics2D g2d; Rectangle2D.Double clipRectangle; double xMin, xMax, yMin, yMax; // double xMinTest, xMaxTest, yMinTest, yMaxTest; // private Point point = null, pressedPt = null, releasedPt = null; //private boolean isZoom = false, isDragged = false; public Canvas() { repaint(); } public void setWellList(ArrayList<WellData> wellList) { this.wellList = wellList; addMouseMotionListener(this); addMouseListener(this); initVal(); } public void setSelectIndex(int selectIndex) { this.selectIndex = selectIndex; } private void initVal() { valuesOfX = new Double[wellList.size()]; valuesOfY = new Double[wellList.size()]; for (int j = 0; j < wellList.size(); j++) { valuesOfX[j] = wellList.get(j).getX(); valuesOfY[j] = wellList.get(j).getY(); } xMin = getMin(valuesOfX); xMax = getMax(valuesOfX); yMin = getMin(valuesOfY); yMax = getMax(valuesOfY); } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); g2d = (Graphics2D) g; if (wellList != null) { propertyArray = new Double[wellList.size()]; // valuesOfX = new Double[wellList.size()]; // valuesOfY = new Double[wellList.size()]; double radius = 0, x = 0, y = 0; height = this.getHeight(); width = this.getWidth(); leftInsect = width / 20; bottomInsect = height / 10; clipRectangle = new Rectangle2D.Double(leftInsect, bottomInsect, width - leftInsect * 2, height - bottomInsect * 2); g2d.draw(clipRectangle); g2d.setClip(clipRectangle); for (int j = 0; j < wellList.size(); j++) { propertyArray[j] = wellList.get(j).getProperty() .get(selectIndex); } // for (int j = 0; j < wellList.size(); j++) { // valuesOfX[j] = wellList.get(j).getX(); // } // for (int j = 0; j < wellList.size(); j++) { // valuesOfY[j] = wellList.get(j).getY(); // } for (int i = 0; i < wellList.size(); i++) { radius = (propertyArray[i] * getPropertyFactor()) * 500; double factorX = (clipRectangle.getWidth()) / (xMax - xMin); double factorY = (clipRectangle.getHeight()) / (yMax - yMin); x = clipRectangle.getX() + ((wellList.get(i).getX() - xMin) * factorX); y = (getHeight() - clipRectangle.getY()) - ((wellList.get(i).getY() - yMin) * factorY); Ellipse2D.Double circle = new Ellipse2D.Double(x - radius / 2, y - radius / 2, radius, radius); if (selectIndex == 0) { g2d.setPaint(Color.RED); } if (selectIndex == 1) { g2d.setPaint(Color.MAGENTA); } if (selectIndex == 2) { g2d.setPaint(Color.BLUE); } g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.draw(circle); g2d.setPaint(Color.BLACK); g2d.fill(new Ellipse2D.Double((x), (y), 3, 3)); g2d.drawString(wellList.get(i).getWellName(), (float) (x), (float) (y)); } g2d.draw(new Rectangle2D.Double(pressX, pressY, draggedX - pressX, draggedY - pressY)); // margin Lines // g2d.setPaint(Color.BLACK); // // X-axis // g2d.draw(new Line2D.Double(leftInsect, (height - // bottomInsect), // width, (height - bottomInsect))); // // //Y-axis // g2d.draw(new Line2D.Double(leftInsect, 0, leftInsect, // (height - bottomInsect))); g2d.setClip(null); g2d.setStroke(new BasicStroke(1.5f)); xTics(); yTics(); } } void yTics() { double yTicsIncrValue = 0; for (int t = 1; t <= majorTics; t++) { // g2d.setPaint(Color.BLACK); // g2d.draw(new Line2D.Double(leftInsect - 10, bottomInsect // + (yTicsIncrValue * getFactorY()), leftInsect + 10, // bottomInsect + (yTicsIncrValue * getFactorY()))); // // DecimalFormat formatter = new DecimalFormat("#0.000"); // g2d.setPaint(Color.MAGENTA); // g2d.drawString( // /* "Tic: " +(10-t) + */" " // + formatter.format((yMin + yTicsIncrValue)), // (float) (leftInsect - 45), // // (float) (clipRectangle.getMaxY() - yTicsIncrValue // * getFactorY())); // // yTicsIncrValue = yTicsIncrValue + (yMax - yMin) / (majorTics - // 1); /*************************************/ double factorY = (clipRectangle.getHeight()) / (yMax - yMin); g2d.setPaint(Color.BLACK); g2d.draw(new Line2D.Double(leftInsect - 10, bottomInsect + (yTicsIncrValue * factorY), leftInsect + 10, bottomInsect + (yTicsIncrValue * factorY))); DecimalFormat formatter = new DecimalFormat("#0.000"); g2d.setPaint(Color.MAGENTA); g2d.drawString( /* "Tic: " +(10-t) + */" " + formatter.format((yMin + yTicsIncrValue)), (float) (leftInsect - 45), (float) (clipRectangle.getMaxY() - yTicsIncrValue * factorY)); yTicsIncrValue = yTicsIncrValue + (yMax - yMin) / (majorTics - 1); /**************************************/ } } void xTics() { double xTicsIncrValue = 0; for (int t = 1; t <= majorTics; t++) { // g2d.setPaint(Color.BLACK); // g2d.draw(new Line2D.Double(leftInsect + xTicsIncrValue // * getFactorX(), height - bottomInsect - 10, leftInsect // + xTicsIncrValue * getFactorX(), height - bottomInsect + 10)); // // DecimalFormat formatter = new DecimalFormat("#0.000"); // g2d.setPaint(Color.GRAY); // g2d.drawString(" " + formatter.format((xMin + xTicsIncrValue)), // (float) (leftInsect + xTicsIncrValue * getFactorX()), // (float) (clipRectangle.getMaxY() + 40)); // // xTicsIncrValue = xTicsIncrValue + (xMax - xMin) / (majorTics - // 1); /*********************/ double factorX = (clipRectangle.getWidth()) / (xMax - xMin); g2d.setPaint(Color.BLACK); g2d.draw(new Line2D.Double(leftInsect + xTicsIncrValue * factorX, height - bottomInsect - 10, leftInsect + xTicsIncrValue * (factorX), height - bottomInsect + 10)); DecimalFormat formatter = new DecimalFormat("#0.000"); g2d.setPaint(Color.GRAY); g2d.drawString(" " + formatter.format((xMin + xTicsIncrValue)), (float) (leftInsect + xTicsIncrValue * factorX), (float) (clipRectangle.getMaxY() + 40)); xTicsIncrValue = xTicsIncrValue + (xMax - xMin) / (majorTics - 1); /*********************/ } } Double getMax(Double arr[]) { Double max, arrayX[] = arr; max = arrayX[0]; for (int i = 1; i < arrayX.length; i++) { if (arrayX[i] >= max) { max = arrayX[i]; } } return max; } Double getMin(Double arr[]) { Double min, arrayX[] = arr; min = arrayX[0]; for (int i = 1; i < arrayX.length; i++) { if (arrayX[i] <= min) { min = arrayX[i]; } } return min; } Double getFactorX() { Double maxX, minX; Double factorX = null; maxX = getMax(valuesOfX); minX = getMin(valuesOfX); factorX = (clipRectangle.getWidth()) / (maxX - minX); return factorX; } Double getFactorY() { Double maxY, minY, factorY = null; maxY = getMax(valuesOfY); minY = getMin(valuesOfY); factorY = (clipRectangle.getHeight()) / (maxY - minY); return factorY; } Double getPropertyFactor() { Double max, min, factor = null; max = getMax(propertyArray); min = getMin(propertyArray); factor = (clipRectangle.getWidth()) / (max - min); return factor / 10000; } @Override public void mouseClicked(MouseEvent e) { // System.out.println("mouseClicked"); } @Override public void mousePressed(MouseEvent e) { pressX = e.getX(); pressY = e.getY(); System.out.println("mouse press X-- "+((((e.getX()-clipRectangle.getX()))/getFactorX())+xMin)); System.out.println("mouse press y-- "+((((getHeight()-e.getY()-clipRectangle.getY())/getFactorY()))+yMin)); } @Override public void mouseReleased(MouseEvent e) { releaseX = e.getX(); releaseY = e.getY(); if(pressX<releaseX) { xMin=(((pressX-clipRectangle.getX()))/getFactorX())+xMin; yMax=(((getHeight()-pressY-clipRectangle.getY())/getFactorY()))+yMin; xMax=(((releaseX-clipRectangle.getX()))/getFactorX())+xMin; yMin=(((getHeight()-releaseY-clipRectangle.getY())/getFactorY()))+yMin; } else { xMin = getMin(valuesOfX); xMax = getMax(valuesOfX); yMin = getMin(valuesOfY); yMax = getMax(valuesOfY); } repaint(); } @Override public void mouseEntered(MouseEvent e) { // System.out.println("mouseEntered"); } @Override public void mouseExited(MouseEvent e) { // System.out.println("mouseExited"); } @Override public void mouseDragged(MouseEvent e) { draggedX = e.getX(); draggedY = e.getY(); repaint(); } @Override public void mouseMoved(MouseEvent e) { } } ________________________________________________________________________________________________________________________ import java.util.ArrayList; public class WellData { private String wellName; private double x; private double y; private ArrayList<Double> property; public double getX() { return x; } public double getY() { return y; } public ArrayList<Double> getProperty() { return property; } public void setProperty(ArrayList<Double> property) { this.property = property; } public String getWellName() { return wellName; } public void setX(double x) { this.x = x; } public void setY(double y) { this.y = y; } public void setWellName(String wellName) { this.wellName = wellName; } } ________________________________________________________________________________________________________________________ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.StringTokenizer; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; public class WellForm implements ActionListener { JFrame frame; Container con; /*** menu item for reading well data */ JMenuItem wellData; WellData well; Canvas canvas; ArrayList<WellData> wellList; JComboBox<String> cmbProperty; ArrayList<Double> property; public WellForm() { createGUI(); importFile(); } void createGUI() { frame = new JFrame("2D"); // creating menu JMenuBar menuBar = new JMenuBar(); JMenu importMenu = new JMenu("Import"); wellData = new JMenuItem("Well Data"); importMenu.add(wellData); menuBar.add(importMenu); frame.setJMenuBar(menuBar); // creating property panel with label and combo JPanel northPanel = new JPanel(); JLabel lbProperty = new JLabel("Select Property"); // property = null; cmbProperty = new JComboBox<String>(); cmbProperty.setEnabled(false); cmbProperty.setActionCommand("Property_Name"); northPanel.add(lbProperty); northPanel.add(cmbProperty); // creating canvas panel canvas = new Canvas(); canvas.setBackground(Color.white); con = frame.getContentPane(); canvas.setFocusable(true); con.add(canvas, BorderLayout.CENTER); con.add(northPanel, BorderLayout.NORTH); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); } private void importFile() { wellData.addActionListener(this); cmbProperty.addActionListener(this); } @Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("Well Data")) { wellList = new ArrayList<WellData>(); JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(null); if (returnVal == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); BufferedReader br; try { br = new BufferedReader(new FileReader(f)); String st = ""; int counter = 1; while ((st = br.readLine()) != null) { counter++; StringTokenizer stringTokenizer = new StringTokenizer( st); if (counter >= 5 && counter < 8) { for (int i = 0; i < 3; i++) { while (stringTokenizer.hasMoreTokens()) { cmbProperty.addItem(stringTokenizer .nextToken()); } } } if (counter >= 8) { well = new WellData(); property = new ArrayList<Double>(); for (int i = 0; i <= stringTokenizer.countTokens(); i++) { while (stringTokenizer.hasMoreTokens()) { well.setWellName(stringTokenizer .nextToken()); well.setX(Double .parseDouble(stringTokenizer .nextToken())); well.setY(Double .parseDouble(stringTokenizer .nextToken())); property.add(Double .parseDouble(stringTokenizer .nextToken()));// property1 property.add(Double .parseDouble(stringTokenizer .nextToken()));// property2 property.add(Double .parseDouble(stringTokenizer .nextToken()));// property3 well.setProperty(property); wellList.add(well); cmbProperty.setEnabled(true); } } } } canvas.setWellList(wellList); } catch (Exception ae) { ae.printStackTrace(); } } }// end if if (e.getActionCommand().equals("Property_Name")) { int c = cmbProperty.getSelectedIndex(); canvas.setSelectIndex(c); canvas.removeAll(); canvas.repaint(); } } }
notes downloadsarthak August 24, 2012 at 8:17 PM
pls download
javaArav Kumar August 24, 2012 at 8:33 PM
what is API?
java nandhini September 5, 2012 at 6:10 PM
hi i want to know notes on stub,skeleton pls give me answer
javazaid September 9, 2012 at 2:40 PM
I have downloaded a project on library management system in core java and it is also working but it is not connecting with database which is with jdbc and odbc. An exception is coming which is java.sql.SQLException:[Microsoft][ODBC Driver Manager] The specified DNS contains an architecture mismatch between the Driver and Application
javaMadhusudhan September 13, 2012 at 10:59 PM
How to searh for learning java audio and video files, pls send me the java audio files i required.
why Runnable interface isn't markerinterface?ramana September 15, 2012 at 9:27 PM
is good
html, css, java, php, msql etcdevendra singh September 19, 2012 at 4:41 PM
very good
java downloadsaadi September 21, 2012 at 3:43 PM
java is good
java detailsselvapriya.c September 25, 2012 at 1:59 PM
hello sir, i need file transfering program using java immediately.can u send?
hichandra kanth September 26, 2012 at 9:40 PM
this website is good for me
binary search tree (java)violet December 15, 2012 at 11:08 PM
Hi, please i need some help to write code about binary search tree to do this : print the lowest common ancestor between two nodes V and W, it can be defined as the lowest node T that has V and W as descendants.(public static void printLCA(int x,int y) )
Display percentage value in Pie Chartsofian December 7, 2012 at 11:35 PM
I did the coding to create a pie chart file in png format file, the pie chart shows the percentage but in the bottom of the file, I want the percentage to appear in the chart itself, This is the codes I have used, String query = "SELECT name,flag from mawarid"; JDBCPieDataset dataset = new JDBCPieDataset( "jdbc:oracle:thin:@ 127.0.0.1:1521:XE", "oracle.jdbc.OracleDriver", "", ""); dataset.executeQuery(query); JFreeChart chart = ChartFactory.createPieChart("Test", dataset, true, true, false); try{ PiePlot plot = (PiePlot) chart.getPlot(); plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0} {2}")); final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection()); final File file1 = new File("Chart5.png"); ChartUtilities.saveChartAsPNG(file1, chart,600 , 400,info); } catch(Exception e) { }
classkamrul December 8, 2012 at 7:37 PM
when give the error following the code: public class AddPersonPanel extends JFrame implements ActionListener{} This error is: package name.class name is not abstract & does not override abstract method actionPerformed
http://www.xgpwatches.com/breitlingbreitling replica September 28, 2012 at 11:29 AM
First of all the idea of the Hoplink, while brilliant, is fundamentally flawed. It fails to take into account of the fact that we as humans, are generally unable to remember large strings of meaningless letters and numbers. If you which to successfully send a link to a prospect, I advise you to use a proper website address and set that address to auto redirect. Not only will it be instantly more memorable but also inspires a far higher degree of confidence in people viewing your link.
javarajan December 11, 2012 at 12:38 PM
super
Help 4 projectLovely Lalit October 4, 2012 at 12:23 PM
WE NEED UR HELP REGARDING OUR FINAL YERA PROJECT
Trainingbalogun adewale October 6, 2012 at 1:35 PM
please i want to confirm if you train students in Java, and other software development programs. I live in Nigeria. Thanks Wale
javareza October 9, 2012 at 12:03 PM
I want to write a program in java that convert color image to grayscale,I used "average( RGB )algorithm", but I'm new in java.would you help me?
java basicsgopi krishnan December 12, 2012 at 6:32 PM
i would like to know java
InformationDharmvir Kumar October 13, 2012 at 1:53 PM
when jsp makes servlet then why makes servlet? Plz send me answer on my email id:
code and definition sruthi October 19, 2012 at 12:46 PM
1)code for generating selective jamming attach using packets. 2)what is selective jamming and jamming attach using packets.
How To download full java tutorialsvalavan s October 23, 2012 at 7:11 PM
Hai, Am using your website to learn java. but i want to download the full collection of your tutorial.. Is its possible to download your full collection of tutorials.. if possible, how can i download the tutorials?...
Core JavaMaharshi October 24, 2012 at 12:36 PM
I Like Java
OAENjuYvdDCJLzQPMkqNjush October 27, 2012 at 2:14 AM
I'm not as big of fan of Rosetta Stone as many people here. Unforgettable Languages did the trick for me, I saw them on NBC nhlgtiy news one night and got their Italian online course, they use a scientific memory method called Linkword and TRUST me it worked well for this dumb Southerner! Oh and they tout themselves as being the fastest way to learn ANY Language think they are cheaper than Rosetta tooHere is the French Free Demo and Information LinkHere is the Spanish Free Demo and Information LinkGood Luck
javamithun November 5, 2012 at 1:55 PM
it is very simple to learn kava
need programming helpRenu November 11, 2012 at 5:44 PM
hai can any one help me ? task : To define a function which looks like my_func(input_db, output_directory). it has to be robust and: Check if there are any matching NS**** or T**** files existing. Only for those files the function has to be executed! All results should be stored inside a user-definable directory. The function should print out how many data sets were found and how many data sets were processed.
java notes with full of example programshari November 14, 2012 at 12:53 PM
Please send me the notes of java which is having full of programs with the description...thanks in advance
java expertaravind November 16, 2012 at 12:58 PM
nice
javaBhuvana.k November 23, 2012 at 2:53 PM
i learn quickly and clearly thank for your help
javaSoumya November 26, 2012 at 3:34 PM
I want to create a java application where computer speaks what i type..how do i start with?
javariyaz ali November 28, 2012 at 5:33 PM
i like your programe very much
javaJav November 29, 2012 at 2:25 AM
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
javagreat November 29, 2012 at 2:27 AM
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
javaone November 29, 2012 at 2:29 AM
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
javaone November 29, 2012 at 2:34 AM
I am trying the run this code in eclipse, but there seem to be some nuances. Can yo please run it for me and and let me know why is it not running? Instruction: Write a java applet that does the following functions based on a hard coded variable named "play". When play = 1 draw one blue circle on the right and display the following text below the circle on the left hand side: "If all our misfortunes were laid in one common heap, whence everyone must take an equal portion, most people would be content to take their own and depart." -- Socrates Code: import java.applet.Applet; import java.awt.*; public class play extends Applet { public void paint(Graphics g) { int play = 1; // value of play variable { int count = 1; // initialize count while (count < 2 ) // run while loop if count is less than 2 if (play == 1) // if the value of play equals 1, then do this { g.setColor(Color.blue); // set color to blue g.fillOval(250, 10, 100, 100); // filled circle g.setColor(Color.black); // set color to black g.drawString ("\"If all our misfortunes were laid in one", 10, 150); // quote g.drawString ("common heap, whence everyone must", 10, 165); // quote g.drawString ("take an equal portion, most people would\"", 10, 180); // quote g.drawString ("be content to take their own and depart.\"", 10, 195); // quote g.drawString("-- Socrates", 10, 210); // quote count = count + 1; // increment count by 1 } // end if else if (play == 2) // if the value of play equals 2, then do this { g.setColor(Color.green); // set color to green g.fillRect(250, 30, 40, 100); // 40 by 100 rectangle g.fillRect(300, 30, 40, 100); // 40 by 100 rectangle g.setColor(Color.black); // set color to black g.drawString ("\"There are only two ways to live your life.", 10, 160); // quote g.drawString ("One is as though nothing is a miracle.", 10, 175); // quote g.drawString(" The other is as though everything is a miracle.\"", 10, 190); // quote g.drawString("--Albert Einstein", 10, 205); // quote count = count + 1; // increment count by 1 } // end else if else if (play == 3) // if the value of play equals 3, then do this { g.setColor(Color.lightGray); // set color to light gray g.drawLine(250, 10, 320, 10); // line 70 pixels g.drawLine(250, 15, 320, 15); // line 70 pixels g.drawLine(250, 20, 320, 20); // line 70 pixels g.setColor(Color.black); // set color to black g.drawString ("\"We are like butterflies who flutter for a day", 10, 60); // quote g.drawString ("and think it's forever.\"", 10, 75); // quote g.drawString("--Carl Sagan", 10, 90); // quote count = count + 1; // increment count by 1 } // end else if else if (play <= 100) // if the value of play less than or equal to 100, then do this // if play were 1, 2, 3, then they would have been processed above { System.out.println ("\n\"I haven't failed, I've found 10,000 ways that don't work.\""); // quote System.out.println("--Thomas Edison"); // quote count = count + 1; // increment count by 1 } // end else if else if (play > 100 && play <=1000) // if the value of play is greater than 100 and less than or equal to 1000, then do this { System.out.println ("\n\"Any science or technology which is sufficiently \nadvanced is indistinguishable from magic.\""); // quote System.out.println("--Arthur C. Clarke"); // quote count = count + 1; // increment count by 1 } // end else if else // if the value of play has not been addressed already, then do this { System.out.println ("\nSorry, Value is out of Range!"); // quote System.out.println("--Amy Krug"); // quote count = count + 1; // increment count by 1 } // end else } } }
appletsandeep singh December 5, 2012 at 12:04 PM
sir, I want to know how to use an applet and what are its various features and advantages
want answersameer March 7, 2013 at 8:22 AM
program to print the 9th number that is both prime and also belongs to the Fibonacci series
pls answer itSameer March 7, 2013 at 8:25 AM
program to print the 9th number that is both prime and also belongs to the Fibonacci series
doubt regording threadrathnakar March 7, 2013 at 2:21 PM
why wait(), notify(), notifyall() placed in object class why not in thread class please give proper explanation about this
javaavdhesh kumar patsariya April 3, 2013 at 11:40 AM
java nots
javavani April 9, 2013 at 8:52 AM
what is complete description n meaning and use of abstract method?
Thank yousijinmary April 12, 2013 at 8:51 AM
r u give code for following algorithm steps
using swing in javasadhna April 13, 2013 at 1:49 PM
how to seprate login registration nd student registration in java using swing
core javaNagarjuna D April 17, 2013 at 6:51 PM
i wnt core java
plz is program ko mouse events k lea teek krdypakeeza April 24, 2013 at 1:10 AM
import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseListener; import javax.swing.*; import org.w3c.dom.events.MouseEvent; import java.awt.event.MouseListener; public class mouseEvent implements MouseListener { JLabel l; JTextField tf; public void mouseEvent() { JFrame f=new JFrame(); JPanel p=new JPanel(); l=new JLabel("Name"); tf=new JTextField("Name"); p.add(l); p.add(tf); f.add(p); tf.addMouseListener(new MouseListener(){ public void itemStateChanged(ItemEvent ie){ } public void mouseClicked(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseEntered(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseExited(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mousePressed(MouseEvent arg0) { // TODO Auto-generated method stub } //@Override public void mouseReleased(MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseClicked(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseEntered(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseExited(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mousePressed(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseReleased(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } }); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(400,400); f.setVisible(true); } public static void main(String arg[]) { mouseEvent me=new mouseEvent(); } @Override public void mouseClicked(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseEntered(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseExited(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mousePressed(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } @Override public void mouseReleased(java.awt.event.MouseEvent arg0) { // TODO Auto-generated method stub } }
Tomcat installation in windows ServerShivashankar April 24, 2013 at 7:41 AM
Hi good morning, As I installed Apache Tomcat 5.5 in windows server(Admin). Now the problem is that only one user can run a program on tomcat server at a time, that multi users not able to run a program simultaneously. Please give some solution to above problem ASAP. Thanks you in advance. Kind Regards, Shivashankar
advance javakrystoff May 3, 2013 at 6:19 AM
1. Implement the Queue class using java collection classes. 2. The following methods must be implemented. public void enqueue(Object o); public Object dequeue(); public Object front(); public boolean isEmpty(); public void clear(); 3. Name you file Queue.java. /* for our latest activity...im having a tough problem
Java program for static methodAbhishek hack April 18, 2011 at 2:09 PM
public class staticc{ int i; static int j; public static void staticMethod(){ System.out.println("you can access a static method this way"); } public void nonStaticMethod(){ i=100; j=1000; System.out.println("Don't try to access a non static method"); } public static void main(String[] args) { //i=100; j=1000; //nonStaticMethod(); staticMethod(); } }
source code for an ieee projectArchana K Prasad June 15, 2011 at 11:48 AM
i need java source code for the ieee project "an energy efficient medium access control protocol for wireless sensor networks"
some help neededTripti Singh December 1, 2011 at 6:21 PM
i have previously saved riht programs,i have installed the jdk1.5 and set te path again and tried to run those programs by command promt.it was compiled successfully ,but on running it given an exception-exception in thread main-no classDefFounnd! ,plz guide me about it,the attempt of running it on netbeans has also failed.
GUI for car rental systemRemz December 5, 2011 at 8:56 AM
I'm not to sure on how to create a GUI's in java and i'm wondering if you could help also I tried to create two new classes but I can not get them to run properly no matter what i do here is my code: package carrental; import java.util.*; import java.util.Scanner; class Res { private String name; private int num; // private String make; // private String model; // private String regNo; private Car reservecar; private int deposit; private int rate; Res(String name, int num, String model, String regNo, int days, int cost) { } public String getName() { return name; } public int getNum() { return num; } } class Car { private String make; public String model; private String regNo; private int deposit; private int rate; public Car(String newMake, String newModel, String newRegNo, int newDeposit, int newRate) { make = newMake; model = newModel; regNo = newRegNo; deposit = newDeposit; rate = newRate; } public String getMake() { return make; } public String getModel() { return model; } public String getRegNo() { return regNo; } public int getDeposit() { return deposit; } public int getRate() { return rate; } } public class Main { public static void main(String[] args) { ArrayList<Res> reservelist = new ArrayList<Res>(); ArrayList<Car> carlist = new ArrayList<Car>(); Scanner input = new Scanner(System.in); carlist.add(new Car("Toyota", "Altis", "SJC2456X", 100, 60)); carlist.add(new Car("Toyota", "Vios", "SJG9523B", 100, 50)); carlist.add(new Car("Nissan", "Latio", "SJB7412B", 100, 50)); carlist.add(new Car("Murano", "Nissan", "SJC8761M", 300, 150)); carlist.add(new Car("Honda", "Jazz", "SJB4875N", 100, 60)); carlist.add(new Car("Honda", "Civic", "SJD73269C", 120, 70)); carlist.add(new Car("Honda", "Stream", "SJL5169J", 120, 70)); carlist.add(new Car("Honda", "Odyssey", "SJB3468E", 200, 150)); carlist.add(new Car("Subaru", "WRX", "SJB8234L", 300, 200)); carlist.add(new Car("Subaru", "Imprezza", "SJE8234K", 150, 80)); int num; System.out.println(); do { System.out.println("\t1. Make Reservation. "); System.out.println("\t2. Delete Reservation."); System.out.println("\t3. Review Reservations."); System.out.println("\t4. Quit."); System.out.println(); num = input.nextInt(); switch(num) { case 1: Make(carlist, reservelist); break; case 2: Delete(carlist, reservelist); break; case 3: Review(carlist, reservelist); break; case 4:System.out.println("Thank you for using this program."); break; default: System.out.println(" Please follow directions\n" + " 1 Make Reservation. \n" + " 2 Delete Reservation.\n" + " 3 Review Reservations. \n" ); } }while(num != 4); } public static void Make(ArrayList<Car> carlist, ArrayList<Res> reservelist) { String name = null; int num = 0; Scanner input = new Scanner(System.in); System.out.print("Enter model to rent: "); String model = input.nextLine(); for (Car s : carlist) { if (model.equals(s.getModel())) { System.out.println("Model " + model + " is available"); System.out.print("Enter number of days: "); int days = input.nextInt(); System.out.println("****Details****"); int cost = days * s.getRate() + s.getDeposit(); System.out.println("Deposit DailyRate Duration TotalCost"); System.out.println(s.getDeposit() + " " + s.getRate()+ " " + days + " " + cost); System.out.print("Proceed to rent?( y/n ): "); String dec = input.next(); if (dec.equals("y")) { System.out.println("Enter Customer Name: "); name = input.next(); System.out.println("Enter IC Number: "); num = input.nextInt(); System.out.println("***Receipt****"); System.out.println("Name ICNo Car RegNo Duration TCost"); System.out.println(name + " " + num + " " + model + " " + s.getRegNo() + " " + days + " "+cost); reservelist.add(new Res(name, num, model, s.getRegNo(), days, cost)); System.out.println("Serving Next Customer "); } else if (dec.equals("n")) { System.out.println("Serving Next Customer: "); } } /* if ( carlist.remove(s)) { System.out.println(" Car not available");*/ } } //Delete reservation made public static void Delete(ArrayList<Car> carlist, ArrayList<Res> reservelist) { Scanner input = new Scanner(System.in); System.out.print("Enter name on reservation: "); String name = input.nextLine(); for(Res f : reservelist) { if(name.equals(f.getName())) { System.out.println(f); } } } //review list of reservations public static void Review(ArrayList<Car> carlist, ArrayList<Res> reservelist) { System.out.println(reservelist.size()); } }
i need help in this exersizeAnisa January 15, 2012 at 2:13 AM
Write a program that creates a text file that contains a power of two table in HTML format. The file could be called "twoPowerTable.html". When it is viewed with a browser you will see something like: Power of 2 Value 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 The file should start with something like: <html><head> <title>Powers of Two</title> </head> <body> <table border cellpadding=5> <tr><th>Power of 2</th><th>Value</th></tr> And end with: </table> </body></html> Each line of the table looks like: <tr><td>0</td><td>1</td></tr>
Databasekovilmani February 8, 2012 at 9:51 AM
code
Post your Comment