I have been working through a problem, and I have working what I need to work. However, it prints out to the command line and I want to output to a GUI. I have set up the GUI and everything seems fine there, the problem is when I try to change the output that was coming through the command prompt to a JTextField. I am getting the following error.
The field DataAnalyzerGUI.dataOutput is not visible
I have made a program on BlueJ but need to transfer the class to a pen drive so that I can take it to school and show it to my teacher. How is this done
I have a servlet that generate a list of objects named "Alerte". I display this list in my jsp and I want the user to be able to delete one of them by clicking on it. Data are stored on Google Datastore. My problem is that I don't know how to pass the current object from the loop of my JSP page to my java class.
try { is = new FileInputStream(file); data = new byte[(int) file.length()]; is.read(data); String extension = ""; int i = file.getName().lastIndexOf('.'); if(i>0)
[Code] ....
Everything works except transferring the image file.
I have a code which transfers images using rmi... This code works fine... But if i give a .avi file instead of a .jpeg the file gets transferred to the other machine but it gets corrupt... The size is also the same... Do I have to encode the video ??
I'm doing this project in JSP.net, with html. and in one of the web pages, what I'm doing is that, a person is transferring an amount to someone else, and if the transfer amount is more than the account balance, then he cannot transfer. else, save details in a table.
Here's the code I've used
<% String t1=request.getParameter("text1"); String t2=request.getParameter("text2"); java.util.Date date1 = new java.util.Date(); SimpleDateFormat ft = new SimpleDateFormat ("dd/MM/yyyy"); int tamt = Integer.parseInt(t2); int bamt = 0;
[Code] .....
But when i enter the fields and click the submit button in the form, to save it in the table, i get the error:
The idea I'd like to present, concerns the correction of "designer" drawings - those done by the design consultants - against "site/construction" drawings - them being used on site by the workers to build the project itself.
This is normally a laborious process, involving being sat at a desk with two large folders, checking each detail and measurement against the design drawing.What I'd like to present is an idea, where the co-ordinates of the design or "mother" drawing, are transferred into a usable Java program, and they could be then used to ensure correct dimensions have been applied by the the sub-contractors in their "construction" drawings.Like I said, this can normally be a process of days for a site engineer to check - process known as "QA, quality assurance".
Basically, I just need to make a presentation of having a genuine interest in Software Design and Development. It could be applied in a range of areas in terms of construction site application - checking drawings, writing up work orders, dig orders etc - but the principle of having the co-ordinates of the mother or "design" drawing scanned into an array in Java as a means to output those site drawings/orders etc, applies to each potential application.
So - in short - and not looking for crystal clear detail, just general pointers - what programs or methods could transfer a plethora of co-ordinates from a design program like Auto-Cad, to a Java program, where I assume I would then be using a program containing a complex series of loops to ensure the correctness of the derived "construction" drawings; derived from the "mother" or designer drawings, that is.
my output fails to display me the 2nd output.Here's my code.
import java.util.Scanner; public class year { public static void main (String [] args) { Scanner console = new Scanner (System.in); System.out.print("Enter the choice of book(A-ABC,D-EFG):"); String x = console.next(); System.out.print("Enter the rate (1-3):"); int y= console.nextInt(); System.out.print("Enter number of kids reading:"); int k = console.nextInt();
[code]....
When I key '0" for kids, it did not appear the second print out. I don't want the first print out to be the output.
import java.util.Scanner; class LeftBottomTriangleNew2 { public static void main(String[] args)
[Code]....
the staircase looks good,however I want to remove the last line and if user chooses 9 i want them to get message "enter number from 1 to 8" and do not print out the staircase.
I am writing this program for my Java level 1 class. I am able to get it to compile and run, however nothing is outputted. Below are the instructions and the code that I have written.
Instructions:
Write an application that calculates and displays the amount of money a user would have if his or her money could be invested at 5 percent interest for one year. Create a method that prompts the user for the starting value of the investment and returns it to the calling program. Call a separate method to do the calculation, and return the result to be displayed.
Below is the code that I have written
import java.util.Scanner; public class Interest { //main method public static void main(String[] args) { originalAmount(); Scanner input = new Scanner(System.in);
You are given a file containing the names and addresses of company employees from many years ago that your manager has asked you to import into a database. You can use a CSV file and your database application to load the file, but the file your manager gave you was exported from an old, non-standard accounting system. Here is its format:
I'm not sure why, but my program does not produce an output. It is supposed to output total charges.
/*This program provides the user with the price of their monthly internet service based on two inputs.The program asks users which subscription they have. The options are A, B, or C. This is the first input.
The program then will ask the user how many hours they used the internet for. This is the second input.Then, based on the package number, the program will compute their monthly bill. This is the output.
The program calculates the price based on the following prices:
Package A: For $9.95 per month, 10 hours of access are provided. Additional hours are $2.00 per hour. Package B: For $13.95 per month, 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month, access is unlimited.*/ import java.util.Scanner; public class Lab03SV
I am learning while loops but the output I am getting is not what I want? My class:
public class BottlesOnWall { public static void main (String[] args) { int x = 99; while (x > 1) { System.out.println(x + " bottles on the wall!");
[Code] .....
The output I am getting is this:
99 bottles on the wall! 98 bottles on the wall! 97 bottles on the wall! 96 bottles on the wall! 95 bottles on the wall!
[Code] ....
I want it to stop on "2 bottles on the wall!" and then print "Only 1 bottle left on the wall!". How do I go about doing that? I have tried different variations of the condition (x>1), I have tried (x>5) but it still goes down to 1 bottle?
It has been about 2 years that I'm programming in JAVA and never has this occurred to me about the reason why this happens. So, in this code snippet
public class Test { public static void main(String[] args) { char m = 'A'; int p = 15; System.out.println(m+p); System.out.println("Answer :"+m+p); } }
The statement "System.out.println(m+p);" returns "80" which is evident that the type of the entire expression is promoted to the value of the largest data type int. But in the statement " System.out.println("Answer :"+m+p);, why does the output change to "Answer :A15" but not "Answer :80"?
I need to display my calculations in a table format using loops.
//Imports import java.util.*; import java.text.*; public class YourLoanCalculator {
[code]....
The increments are correct, but I wanted them listed under the "Payment #:" column. I figure that if I do that, I can also correctly display the interest, principal, unpaid balance and total interest paid at that point, right?
I would like to enter a new item into a CSV file but all my items being entered are all staying on one line in the CSV file. I would like each new item to show up on a new line and I can't seem to find the code to make it work.
public String addItem(String newItem, int credits, String code) { String money = Integer.toString(credits); try { BufferedReader itemsCSV = new BufferedReader(new FileReader("itemList.csv"));
I have a for cycle in which I have a line for printing in the output file. But the file remains empty.
I inserted ShowMessageDialog in the same cycle in order to see what are the results of the calculations that are supposed to appear in the output file, and I see that the results are fine.
[URL] I am unable to get any XML output. I am unable to figure out how to send the contents of System.out to a String that can be printed. I saw an SO post and tried using ByteOutputStreamArray, but that did not work.
How can I extract data from two different files but produce one output. For example, the first three columns are from text_file_1 and the last column (the last foruth column of the output) is from text_file_2...
I am working on a program that accept input file from user and then from the input file, it count the occurrence for each words then put those result into the output. However, after I run this program, nothing shows up in the output file. It is totally empty...It seems nothing wrong with my code... Here is my code
import java.util.*; import java.io.*; public class occurance { public static void main(String[] args){ String inputFileName=""; String outputFileName=""; if(args.length == 0){