- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 7
- Posts with Downvotes
- 6
- Downvoting Members
- 5
36 Posted Topics
Re: Please make it clear of what exactly you want to do in a database? Do you want to search the productname, or expirydate etc. If you can make it clear then I can help you out Regards Sincerelibran [QUOTE=jrosh;1005686]Please any one can guide me how to write a [B] mysql … | |
Dear Friends, I have a frame which is a JSplitPane which is split horizontally into two. On the upper half I want a JFrame to appear and on the lower half I want a JTable to appear. I tired but couldn't get the answer correctly. Will anyone be able to … | |
Re: Applets are small applications that are accessed on an Internet Server, transported Internet, automatically installed, and run as part of a Web document. Applet is a program written in Java and included or embedded in an HTML page. An applet is automatically loaded and executed when you open a web … | |
Re: You have to consider how many dentists are there and store the details of them. You have to allocate different slots for the dentist and assign a patient to each slot. You have to store the details of the patients and also the history of treatment. Generate reports according to … | |
Re: Please try this code [CODE] import static java.lang.System.out; import java.util.Scanner; public class ReadMain { public static void main(String[] args){ int moneyEarned = 0; Scanner myScanner = new Scanner(System.in); System.out.println("Please Enter Money Earned Tutoring"); int userEnteredMoney = myScanner.nextInt(); moneyEarned = moneyEarned + userEnteredMoney ; System.out.println("15" + " hours and " + … | |
Re: Please try this code. It is working fine and will give you the desired result. [CODE] public class AddSample{ public static void main(String args[]){ int asd = 13; int dfg = 24; double result = 0.0; result = (double)asd/dfg; System.out.println(result); } } [/CODE] | |
Re: You have declared the object for the Inventory class. But you have not allocated the memory for it. So you have to write that statement explicitly. [CODE] Inventory inventory; inventory = new Inventory(); JTextField txtMoney = new JFormattedTextField(inventory.getInvWallet()); [/CODE] Hope this will work fine for you. Try it out and … | |
Re: Hope this will solve your problem. I'm giving you the code of two programs (frames). First one id the MainFrame. When you click the button on this MainFrame it will take you to another Frame name MainMenu. Try this out This is the code for MainFrame.java [CODE]import java.awt.*; import javax.swing.*; … | |
Re: The code is working fine as everyone said. The problem is with the message you have given within the do while loop. When you enter 999 the loop is working fine and is giving you the desired output which is "You must enter a house number between 1 and 1000". … | |
Re: Is this what you are looking for? [CODE] import java.util.Scanner; public class Fibonacci { public static void main(String[] args) { int fib; int n; Scanner scan = new Scanner(System.in); System.out.println("input a number"); n = scan.nextInt(); System.out.println(calcFib(n)); } public static int calcFib (int n) { int ans; if (n<2) { ans … | |
Re: Please try this code. Compile the program in the command prompt using javac Palindrome.java and run the program by giving java Palindrome 121 in the command prompt. Hope this will work fine for you. If there is any change kindly let me know. [CODE]public class Palindrome { private int num; … | |
Re: Here the problem is with setting the limits for the condition of the if statements [CODE]if((OccupantsInput > MAX_OCCUPANTS) || (OccupantsInput < 0)){ System.out.println("Occupancy limit was exceeded"); } [/CODE] Hope this code will work perfectly. | |
Re: kindly make the following changes in your code. [code]</style></head><body>[B]<center>[/B][/code] and in the first table include [code]<table cellpadding="0" cellspacing="0" border="0" class="style4" [B]align="center"[/B]>[/code]. The center tag has to be closed before the end of the body tag. You have to give center align to both. Then the text will be aligned almost … | |
Re: For each cell in htm table that you use you have to specify the alignment. Otherwise it'll surely look different in different browsers. In IE the default alignment is "center" and in Firefox the alignment is "left". So if you won't specify any alignment for each cell it'll look surely … ![]() | |
Re: You have to set the classpath correctly to execute your program. in the command prompt or in the editor that you use, please set the classpath. In command prompt you can set the classpath like this: [code]set classpath=%classpath%;.;D:\java\programs;[/code] where D: is the drive in which the programs are stored and … | |
Re: Please try this code after the statement [code]body.close();[/code] . The statement is [code]setDefaultCloseOperation(EXIT_ON_CLOSE)[/code]; | |
Re: Dear Friend, the data source name is 'lib' which you have specified in the String url. You have to create that data source name from the control panel. The steps are: Open Control Panel > Administrative Tools > Data Sources (ODBC) > Click Add button there > Select the driver … | |
Re: when i convert my java code to java applet code, there is no error, but when i run the code, the command prompt display Exeption in thread "main" java.lang.NoSuchMethodError: main This exception occurs because the classpath is not set to the current directory of yours. Yuo can set the classpath … | |
Re: [code]public class Person { public String Name; public String SocialSecurityNumber; public String PhoneNumber; public Person(String name, String socialSecurityNumber, String phoneNumber) { Name = name; SocialSecurityNumber = socialSecurityNumber; PhoneNumber = phoneNumber; } @Override public boolean equals(Object compareObj) { if (this == compareObj) // Are they exactly the same instance? return true; … | |
Re: You can write any number of classes in a single Java program. Suppose I've written three classes A, B and C in the same java file. Then any one of these classes will have the main method. Suppose class C has the main method inside it. Then the name of … | |
Re: The problem is solved in the other thread you have posted.....Enjoy!! | |
Re: [CODE]import java.awt.Graphics; import javax.swing.JApplet; class WelcomeApplet extends JApplet { public void paint (Graphics g) { super.paint (g); g.drawString ("Welcome to Java Programming!", 25, 25); } }[/CODE] [CODE]<html> <applet code="WelcomeApplet" width="300" height="45"></applet> </html>[/CODE] The above html code works fine. For viewing the output of the above applet you have to create … | |
Re: First of all, an Applet doesn't have a main method. You have to remove that main method and must write that windowClosing() event within actoinPerformed(). Hope when you remove the main method almost half of your problem will be solved. Please do it and let me know the error you … | |
Re: The print method is a pre-defined method in Java. There is the println() method and the print() method. This is a static method of the PrintWriter class. Its better if you change the name of that method and try. If you have to use print() method compulsorily then you have … | |
Re: use this MainProgram mp = new MainProgram(); mp.setVisible(false); This way you can hide the MainProgram JFrame. Don't think of disposing it. This is another alternative. Regards Sincerelibran [QUOTE=kathmartir;1005922]I have a problem with the dispose method. . .I got 3 java files with a class name: MainProgram.java MainPanel.java PageOne.java The MainProgram … | |
Re: import java.io.Writer; import java.io.PrintWriter; Try this Regards Sincerelibran [QUOTE=kat1;1005702]I am using java.io package in my j2me programe in order to use PrintWriter but package does not show PrintWriter option nor it shows BufferedReader option , why this happen ??i do not know.if any one knows the solution plz tell me.is … | |
Re: use distinct select distinct vFirstName from User where vFirstName is the attribute/field and User is the table name | |
Re: Use Java Swing for developing the web browser. You have to compulsorily use Threads. In order to perform multithreading it is very much needed. Remember we can do more than one task at a time using the browser. So if it has to happen you have to use threads. Use … | |
Re: Kindly declare [B]double m_d = 0.0;[/B] above the updateMyPanel() method. | |
Re: Do you want to see both of them at the same time or one at a time? | |
Re: [QUOTE=sgsawant;908448][COLOR="Red"]The program is given at the bottom[/COLOR] To compile java programs in the command prompt I use the following command: C:\jtemp\MyPack>javac AccountBalance.java -d . Only then are the classes compiled and I am able to run the main() function. When I execute the above command a folder "MyPack" is created … | |
Re: > Dear mates, I am am frustrated and bored to learn how to get or calculate coordinates data for Java Graphic API. > > for ex the GeneralPath 's function curveTo() takes 6 parameters namely x1,y2,x2,y2,x3,y3.I put some random coordinates data > into these function and got a crap drawing. … | |
Re: > Hi. I'm new to java programming. I have some questions: > > 1) Does every java source code's [B]class name[/B] (the name after the [I]class[/I] keyword, e.g. [I]class[/I] [B][I]Hello[/I][/B]) has to be started with an uppercase character? > > 2) Does the java source code's **file name** (e.g. **Hello**.java) … | |
Re: Dear Friend, this error can be due to the difference in data type of the column name and the data you're passing. The data type doesn't match. Maybe in the database the Field is defined as type integer and you've passed String value to it. Anyway the error is due … | |
Re: Dear Friend, you have to use import java.text.*; since the Format and DateFormat are a part of java.text package. If you do that you won't get any error message. | |
Re: [QUOTE=redZERO;821681]I was wondering do all programs have a unnamed thread by default? For example, if i have a very basic program, can i put Thread.sleep(int) anywhere in it and it will make the program sleep for a set amount of time?[/QUOTE] Every program has a default thread, a single sequential … |
The End.