Java Table Question - Celsius Conversion?
-
I'm writing a program that displays a table of the Celsius temperatures 0 through 20 and their Fahrenheit equivalents. The problem I have is that I don't know how to use the JOptionTable class, and that's the way my professor wants it. It's in systemprintln right now, but I'm stuck on how to change it to a table using the joptiontable class. import java.text.DecimalFormat; public class TempTable { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub DecimalFormat C = new DecimalFormat("#0.0"); DecimalFormat F = new DecimalFormat("#0.0"); System.out.print("We will display a table of the Fahrenheit tempertures" + "\n0 through 32 and their Celsius equivalents.\n"); System.out.println("Fahrenheit" +"\t\t" + "Celsius"); System.out.println("--------------------… for (double fahrenheit = 0; fahrenheit <= 32; fahrenheit++) { System.out.println(F.format(fahrenheit) + "\t\t" + C.format(celsius(fahrenheit))); } } public static double celsius(double fahrenheit) { return (fahrenheit-32) * .55555; } }
-
Answer:
Here are the guides... http://docs.oracle.com/javase/tutorial/uiswing/components/table.html http://answers.yahoo.com/question/index?qid=20071120042928AA48cVW Good luck!
Rob at Yahoo! Answers Visit the source
Related Q & A:
- How to add primary key from multiple table as a foreign key in a table in sql server 2008?Best solution by stackoverflow.com
- What is Hash Table, how to create a hash table?Best solution by Stack Overflow
- How can I track third party conversion?Best solution by Quora
- How do I change the temperature from Fahrenheit to Celsius in the new Yahoo mail?Best solution by Yahoo! Answers
- Is 2 degrees Celsius cold?Best solution by lenntech.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.