peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What is change????????
your Change class must be in same class Assign6 or if u have define in other class then use package to import that class

Not that you are 4th person to mention, why bother to read previous posts hmm, waste of time isn't it...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There gone be something wrong with your code. Can you please post it?

PS: Use code tags, press hash "#" sign on post toolbar and paste your code between the tags which will appear

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

This deffenetly is not compiler error. It is the code writter/author error! You telling to your program to use a class called Change but is it implemented somewhere? I do not see it :|

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There are some nice tutorials for Date and Time of Java section, it is up to you to implement it.
Next time JSP related questions posr in >Web Development>>JSP

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Everybody have to learn somewhere...
It is better to learn from other people mistakes but sometimes we can not avoid to do some stupid things by ourselfs.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You should always check the size of the display for given mobile device and resize the components base on that. There was an interesting book on mobile games, if I found what was title I will post it here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK, sorry I misunderstand your question...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no need to combine them in one file. You just need to iplement some methods for it to work as you need to...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If this was your code you would know that is actauly 2 java files in one you try to compile as just one file! ! !
//Employee.java

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Simple functonality provided by HTML
example from w3scools.com

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You can use any IDE to do your coding and compiling, but then you need Sun Java Wireless Toolkti 2.5.2 for CLDC(Sun site, download).
Other option is to use NetBeans and download Mobility pack for it ( 2 files, CLDC and CDC), Eclipse and choose one of 7 plugings (I recommend EasyEclipse ME - didn't use it but been told is good one) or use profesional package (jwenting gone like it) as IntelliJ IDEA which comes with preinstall plugin and one custom IntelliME J2ME. My university got academic licence for IntelliJ so I'm using it ;)
All these IDE's will produce JAR and JAD files that you can simply upload to your device through USB cable/Infrared/Bluetooth/upload on memory card/store on web and download it to device(that will cost you)

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Reading from file tutorial
Writing to file tutorial

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Will be this forum directly linked to daniweb user database or do we need to create new account?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

The Java Tutorials - String

Using String's static format() method allows you to create a formatted string that you can reuse, as opposed to a one-time print statement. For example, instead of

System.out.printf("The value of the float variable is %f, while the value of the " + 
                       "integer variable is %d, and the string is %s", floatVar, intVar, stringVar);

you can write

String fs;
    fs = String.format("The value of the float variable is %f, while the value of the " + 
                       "integer variable is %d, and the string is %s", floatVar, intVar, stringVar);
    System.out.println(fs);
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

OK, let ask it this way. Is there any other IDE other then microsft ones?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Keep up good work...

PS: In future please be more specific about what you asking and source code is always good way to explain your problem

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Is there any other IDE for Windows CE development besides Visual Studio?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I just want to make a small side note that you can transfer, or better say save, your excel spreadsheets as XML document and use it with PHP or any other language that is able to process it...
This way you can also keep it easily uptodate too.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

To be more precise, post your code which you should have by now at least started. Point where you running into troubles and we will see what can be done about it

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Not the most vonderful tutorial but should do it http://www.roseindia.net/java/example/java/swing/ChangeScrollBarValue.shtml. If you want to learn on Swing this is good book Swing: A Beginner's Guide by Herbert Schildt

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I think that education system in UK is very tolerant, they could be harder on students. Back home(Slovakia) you still have to go trough selection process and often writen examination before you admited to join university. Where here strangly they admit as many students as they can and doesn't matter what their knowledge in given area is they hope to teach them everything from scratch. Then they got large number of students leaving or changing university/course path for various reasons.
This year I'm taking my MSc in Mobile Computing and teaching approach is different, very are finaly expect to do lot of work on our own. Some people have problem to cope with it they they praining and wishing it was like before. For me, I wouldn't change it... :D

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

if you want to match string agains string you need to use String method equals() or equalsIgnoreCase(String anotherString).
Secondly to store score you need only one variable and not four plus you DO NOT need else if part of statement! String is either what is correct answer and score get increased or it is not and score remain as it was...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

It is little silly to start war over something like this...

On one hand I do argee with jwenting that university does not fully prepare you for real-life job as programmer. It is very short time spam to get and learn something in depth as they try to give as more option to choosee from. I finished my BSc degree just this summenr and I have to admit that I just got broad knowledge in programming (we did C++, C, Java and some PHP and Perl) for all you guys working in industry that will just basics such as GUI, DB connectivity and very-very little of networking.
On the other I do not agree with you jwenting. The percentage counts for students that do they homework must be higher, I consider to be something about 20%, but that still very low.

@schoolsoluction & kukushkin - university Java knowledge will not realy get you job and not all your wishes will come true

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Nothing like that in html. Html is just markup language in the way how you wish to display your data in browser, and has no procesing ability. These is a reason why plain html pages are called "static pages". So either find something in java or work out something on your own...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Please post your code

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Google is your friend! There are many examples over the internet, for example this site http://www.java2s.com/Tutorial/Java/0340__Database/Catalog0340__Database.htm

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do you have any specific reason to change from List to Array? I think that data are better kept in List which can dynamicaly grow then in fix size array...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

API for BufferedWriter it say it loud and clear

A newLine() method is provided, which uses the platform's own notion of line separator as defined by the system property line.separator. Not all platforms use the newline character ('\n') to terminate lines. Calling this method to terminate each output line is therefore preferred to writing a newline character directly.

so your code may look like this after transfer

import java.io.*;
import java.util.*;

class WriteTest
{
	public static void main(String[] args)
	{	
		try {
			BufferedWriter out = new BufferedWriter(new FileWriter("test.txt"));
			out.write("aString");
			out.newLine();
			out.write("this is a");
			out.newLine();
			out.write("ttest");
			out.close();
		}
		catch (IOException e)
		{
			System.out.println("Exception ");		
		}
		
		return ;
	} // main ends here.
}; // the class ends here.

This however is sort of silly solution so you have to think how you gone approach it. You need to temporary store your strings in Vector or List and on the ned to loop it through and write to file

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

The whole for statement is wrong!

Can you explain what you trying to achive?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Substance was just to make it different from L&F as many know. It wasn't core part of project so no point to laught on that count.
However you can laught as much you want, university project must look to you very silly after years in industry, however for me it was something new and I made maximum effort my project to be different from others. I'm happy to say I made the difference...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you did not attach anything...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

yeap JGoodies is another option. I used Substance for my final year project and like it. However I hope to try out JGoodies too

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Would be nice if you can share your findings with others...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Use class Arrays. This class contains various methods for manipulating arrays.

Info from API on sort(int[] a)

Here is a nice refference to sorting

An here is just small quick example

import java.util.*;

public class Sort {
    public static void main(String[] args) {
    	int[] arr = new int[] {5, 3, 1, 6, 7};
		Arrays.sort(arr);
		for(int i =0; i< arr.length; i++)
		{
			System.out.print(arr[i] + " ");
		}
		System.out.println();
    }
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Windows XP look&feel? Everybody know have that looks like. Try something new ! ! !

Come on try Substance

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I consider rude to come here and ask for help on project for illigal activities.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Beginning J2ME from Novice to Professional 3th edition from Apress(2005) is very good resource and google with "j2me tutorial" will give more then you can ever read.
PS: Make sure you check website latest update so you do not read some irelevant old non-sence

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Always good place to start your search is http://java.sun.com/docs/books/tutorial/
also, google search for "java tutorial" or more specific "java button tutorial" bring plenty of other resources.
To second question if I got it right, you want to use ButtonGroup and give it some caption/title. If that what you want, then this is no complex. For caption use Label/JLabel where you pass string which is displayed and together with ButtonGroup put them into Panel/JPanel

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Man!!!!
Why so many posts about something to which you have solution in my post?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Update in code marked with red colour. There is no method nextChar for Scanner !

//Calculate Program
import java.util.Scanner;

public class Calculate
{	
	public static void main(String args[])
	{
		Calculator calc = new Calculator();// new Calculator
	
		char selection;
		char yesNo;
		Scanner input = new Scanner(System.in);
		//This is the priming question. It starts the calculator and
		//should only run once.
		System.out.printf("Do you want to perform a calculation now?\n");
		System.out.printf("Select 'Y' for yes, or anything else for no.\n");
		yesNo = input.nextLine().charAt(0);
		
		//This while loop tests the initial answer. If user didn't enter 'Y'
		//then loop and program should terminate
		while(yesNo == 'Y' || yesNo == 'y')
		{
		
			//This section is where user selects type of operation
			System.out.printf("What operation would you like to perform?\n");
			System.out.printf("Enter '+' for add, '-' for subtract\n");
			System.out.printf(" '*' for multiply '/' for divide\n");
			
			selection = input.nextLine().charAt(0);
			
			//This inner loop tests for operation type. User must enter valid
			//response or loop won't end
			while(selection != '+' && selection != '-' && selection != '*' && selection != '/')
			{
				System.out.printf("You need to enter a correct character.+-*/\n");
				selection = input.nextLine().charAt(0);
			}
			
			//At this point, a valid operation should have been entered. This
			//section should call appropriate method for the operation
			if(selection == '+')
			calc.add();
			
			if(selection == '-')
			calc.sub();
			
			if(selection == '*')
			calc.mult();
			
			if(selection == '/')
			calc.div();
			
			//This section is the end of the first while loop. It gives user
			//the option to exit or perform another operation.
			System.out.printf("Do you want to perform another calculation\n");
			System.out.printf("Enter 'Y' for yes, or …
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If you wish to get help with your code you better provide full code not just one class. Calculator class is missing.
By-the-way to insert code into post do not use INLINECODE tag, but press hash sign "#" in the post bar or just simple type CODE tags and place your code between these tags

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Justed puted your code between tags so it more readable. Please use them in the future...

import javax.swing.JOptionPane;

public class ComputeTaxWithMethod {
	public static void main (String [] args) {
		// Prompt the user to enter filing status
		String letters = JOptionPane.showInputDialog(
		"Enter the filing status:");
		int status = Integer.parseInt(letters);
		
		// Prompt the user to enter taxable income
		String symbol = JOptionPane.showInputDialog(
		"Enter the taxable income:");
		double income = Double.parseDouble(symbol);
		
		//Display the result
		JOptionPane.showMessageDialog(null, "Tax is " +
		(int)(computeTax(status, income) * 100) / 100.0);
		
		System.out.println("income \t\t tax ");
		System.out.println("________________________");
		System.out.println(income + "\t\t" + (int)(computeTax(status, income) * 100) / 100.0);	
	}
	
	
	public static double computeTax(double income,
	int r1, int r2, int r3, int r4, int r5) {
		
		double tax = 0;
		
		if (income <= r1)
		tax = income * 0.10;
		else if (income <= r2)
		tax = r1 * 0.10 + (income - r1) * 0.15;
		else if (income <= r3)
		tax = r1 * 0.10 + (r2 - r1) * 0.15 + (income - r2) * 0.27;
		else if (income <= r4)
		tax = r1 * 0.10 + (r2 - r1) * 0.15 + (r3 - r2) * 0.27 + (income - r4) * 0.35;
		else
		tax = r1 * 0.10 + (r2 - r1) * 0.15 + (r3 - r2) * 0.27 + (r4 - r3) * 0.30 + (r5 - r4) * 0.35 + (income - r5) * 0.386;
		
		return tax;
	}
	
	public static double computeTax(int status, double income) {
		switch (status) {
			case 0: return //Compute tax for Single
			computeTax(income, 6000, 27950, 67700, 141250, 307050);
			case 1: return //Compute tax for married joint
			computeTax(income, 12000, 46700, 112850, 171950, 307050);
			case 2: return //Compute tax for married separately
			computeTax(income, 6000, 23350, 56425, 85975, 153525);
			case 3: return //Compute tax for head of a house
			computeTax(income, 10000, 37450, 96700, 156600, 307050);
			default: return 0;
		}
	}
}
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I' have no idea about Java, but I have done it in C++

for once this is java forum, secondly this post is nearly 3 years old so what you trying to achive?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No, because it need to be checked for FileNotFoundException. So you can inplemented in it own class or just a method which will deal with printing request

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

you missing break after most cases in your switch statement

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Nothing to do with existing code. NetBeans are complaining about build-impl.xml file. You must done something wrong while importing or copying.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I had some weird problem some times ago when jar created on my desktop will not run, but when I tried on laptop I had no problem at all.
On the end I changed JAR file settings in Folder Options>File Types and cahnge it execution of javaw.exe from jre to jdk and it worked fine. However it shouldn't make any differences if javaw.exe is called from jre or jdk, so :?:

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do you think that user of your application will be interested in reading your code and seting all variables by him self? Or do you think all variables are always initialized?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@nschessnerd , you better test it before you submiting something or you may be providing wrong solution an waisting your and poster time...

import javax.swing.JOptionPane;

public class GPA {

	private double gpa = 0.0;
	private int classNum;
	private String gradeInput;
	
	public GPA() {
	}	
	
	public String UserInput(){
		gradeInput = JOptionPane.showInputDialog("Enter Grade:");
		return gradeInput;
	}
	
	public double inputGrade()
	{
		int end = 0;
	    for(classNum = 1; classNum <= 7; classNum++)
	    {
	    	gradeInput = UserInput();
	    	
	    	switch(Character.toLowerCase(gradeInput.charAt(0) ))
	    	{
	    		case 'q' :
	    			classNum = 8;	    			
	    			break;
	    		case 'a':
	    			gpa += 4.0;
	    			end = classNum;
	    			break;
	    		case 'b':
	    			gpa += 3.0;
	    			end = classNum;
	    			break;
	    		case 'c':
	    			gpa += 2.0;
	    			end = classNum;
	    			break;
	    		case 'd':
	    			gpa += 1.0;
	    			end = classNum;
	    			break;
	    		case 'f':
	    			gpa += 0.0;
	    			end = classNum;
	    			break;
	    		default:
	    			break;
	    	} // close switch	    	
	    	
	    }
	    return gpa/end;
	}
	
	public static void main(String [] args)
	{
		GPA runProgram = new GPA();
		System.out.print(runProgram.inputGrade());
	}
}

I understand that gpa should return everage mark so I ajusted calculation. If I'm wrong please corect it as necessary. The code bellow return gpa, so now you have to think how do you gone find if person had any "F" in the results