32,204 Topics
| |
Hello, I have been working on file transfer in java using http POST. I'm able to to send text files to a server but I'm getting difficulty in sending binary data, like images, to a server. My main problem lies on how to use InputStream.read(buf, 0, dataLength). Here is my … | |
So if my program exits on a certain condition, it has to exit with a 1, and if something else, it exits with 2. So I want to use junit to assert that the exit code is 2, but I don't know how to do that. I also heard there … | |
[code] import javax.swing.*; import java.io.*; import java.io.InputStreamReader; public class Weight2 { public static void main(String[] args)throws IOException { double cost; double tax; cost=Double.parseDouble(JOptionPane.showInputDialog("Enter purchase amount")); double payment; payment=Double.parseDouble(JOptionPane.showInputDialog("Enter amount tendered")); BufferedReader CHANGE=new BufferedReader(new InputStreamReader(System.in)); tax=Double.parseDouble(CHANGE.readLine()); displayTax(getTax(cost,tax)); setPayment(payment); setTax(tax); setCost(cost); displayCost(getCost(cost,tax)); System.exit(0); } public static double getTax(double y, double x) { … | |
how can i remove an element in my array without using special commands like hashmap....i have made many parts of it...just the delete part... [CODE]import java.io.*; public class Super { public static void main(String args[])throws IOException { String temp; int num[]=new int[10], choice,index,value,i,search,found=0; BufferedReader in; in = new BufferedReader(new InputStreamReader(System.in)); … | |
I need to figure out how to find the max number of an array by using a while loop. I have searched all over but do not understand how to do it. If I could get any help at all that would be great. Thanks! Anyway the findMax method is … | |
Hey everyone, I'm currently writing a simple text based MUD in Java for learning purposes. Currently I'm in the process of coding a Login class that prompts the user to enter a user name and password in order to access the account. Right now the problem lies in opening a … | |
hi, i m just wanna open/explore/view inside of any txt or doc file from folder by using JFileChooser... here i made the code, pls tell me what need to add to open the files.. [CODE] import java.io.File; import javax.swing.JFileChooser; public class OpenFile { public static void main(String args[]) { JFileChooser … | |
Hi, I need to create a time delay before I call a method. [CODE]public void brewDrink(CoffeeMachine coffeemachine) { try { coffeemachine.displayDrinkBrewing(); Thread.sleep(7000); setDrinkReady(coffeemachine); } catch (InterruptedException ex) { } }[/CODE] This doesn't work, the method isn't called. Any help or pointers are welcome! | |
I want to remove the JOB node with JOBNAME "One" from the following file: <SETTINGS> <SYSTEM> <VERSION>3.1<VERSION> </SYSTEM> <JOB> <JOBNAME>One</JOBNAME> </JOB> <JOB> <JOBNAME>Two</JOBNAME> </JOB> </SETTING> The code that is supposed to remove it looks like this: [CODE]try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder docBuilder = factory.newDocumentBuilder(); Document doc = docBuilder.parse(new … | |
Hi i have the next task to solve. [I] A bank holds different types of accounts for its customers: – Deposit accounts – Loan accounts – Mortgage accounts Customers could be individuals or companies. All accounts have customer, balance and interest rate (monthly based). Deposit accounts are allowed to deposit … | |
how we can send binary sms to any mobile particularly nokia mobile from pc using smpp... | |
I am trying to write a java program for a SNMP,DNS using UPD datagram. I am trying to think of how to start. Anyone has any suggestions? Please advise | |
Hi I am trying to genarate report in java. my basic requirement is like: 1. i have to print sales invoice in .txt format. 2. In application, user will select sales invoice no in drop down list. after clicking print button, user can show his invoice . 3. invoice contain … | |
Can anyone help me to implement binary search tree with addition ? | |
Hello, Nice post man...but do you have nay link for the java monkey engine that is used for creating games? | |
Hi! i need to insert a new element in an existing xml document. for example, [code=xml] <details> <person> <name>Anu</name> <email>abc@yahoo.com</email> </person> <person> <name>thara</name> <email>xyz@gmail.com</email> </person> </details> [/code] In this document if i want to insert another element using Xpath, say,<publisher> in <book> node, how to insert it. I'm using DOM … | |
So I have a web audio stream that I would like to capture. What I want this program to do is grab the stream, record it and write it to a file (mp3, wav..whatver codec that is easy) and create one hour intervals of the audio stream. So every hour … | |
Hello all, I have created an RSS object and I would now like to parse out the descriptions of the children. My knowledge of RSS is extremely limited so pardon me if I am incorrect in explaining what I need. For example, I am connecting to [url]http://rss.cnn.com/rss/cnn_topstories.rss[/url] and I would … | |
I am a adult returning student in Java and would really benefit from having someone work with me on exercises to further my understanding of the material. Anyone interested in helping would be greatly appreciated. | |
I was wondering if someone can help me with how to convert my code so that it converts the cents to dollars and also round to the nearest cent: [CODE]public class Subscription { private int price; private int length; public Subscription(int p, int n) { price = p; length = … | |
I'm currently taking Java I and I have to write a program that reads 5 integers and determines and prints the largest and smallest numbers without using an array. I have to only use the if statements. I can't figure out how to make the if statement apply to 5 … | |
hello please help me on this i make a simple program that inputs the first name and family name and age, and this will display to the table ...can you help me how to delete the save data on my JTable the one that i inputed ...thanks in advance hoping … | |
hello can you help me please... i have a button print and i dont know how to make the code that will print all my data in my database....please help me how to make this print code ..hoping for your positive responds. | |
I have written my program to prompt the user to enter an integers and then print if the number is odd or even. It says build successful, but will not prompt for the information to be entered and print the data. I use Netbeans with the JDK bundle. Please help. … | |
Hello all! I thought I was finally getting good at this "Java" thing, and then someone suggests to me that I use a singleton and factory class. I'd never heard of these before so I set off googling it. Now, I get the gist of singleton and factory classes, but … | |
I am using Ubuntu 9.04. I want to shutdown my PC using Java, when some Event is called. Please suggest what could be done. | |
kindly please tell me how to connect from java to ms access, sql,oracle and so etc . with example | |
Hello to all my fellow IT people! I have two questions! I would like to start learning how to program! Is Java a good beginners language to start with and if it is not what is a good language? My second question is if Java is a good language then … | |
public double getThirdSide() If the triangle is not valid, this should return 0. Otherwise it should return the length of the third side of the triangle. i cant figure out how to put this into coding any help thanks [CODE]public class Triangle { //PART 1 // a triangle is defined … | |
Hi all, I'm new to java applets. This is basically my first bigger applet. It works 100% fine when I run it in the applet viewer. As soon I start it in a web browser it stops working half way through. The code below is a short version of my … |
The End.