32,204 Topics

Member Avatar for
Member Avatar for syum

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 …

0
54
Member Avatar for iamsmooth

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 …

Member Avatar for musthafa.aj
0
123
Member Avatar for mhina

[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) { …

Member Avatar for musthafa.aj
0
151
Member Avatar for kiryoku

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)); …

Member Avatar for BestJewSinceJC
0
218
Member Avatar for nicklbmx

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 …

Member Avatar for BestJewSinceJC
0
90
Member Avatar for clisen

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 …

Member Avatar for clisen
0
144
Member Avatar for doha786

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 …

Member Avatar for peter_budo
0
114
Member Avatar for benregn

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!

Member Avatar for verruckt24
0
101
Member Avatar for P00dle

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 …

Member Avatar for P00dle
0
5K
Member Avatar for checho

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 …

Member Avatar for checho
0
159
Member Avatar for sweetyyyy

how we can send binary sms to any mobile particularly nokia mobile from pc using smpp...

Member Avatar for verruckt24
0
215
Member Avatar for palanisaamy

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

0
39
Member Avatar for guravharsha

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 …

Member Avatar for JamesCherrill
0
193
Member Avatar for Namrata.Bibodi
Member Avatar for verruckt24
0
118
Member Avatar for jodysmith

Hello, Nice post man...but do you have nay link for the java monkey engine that is used for creating games?

Member Avatar for peter_budo
-3
73
Member Avatar for indu_ss4

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 …

Member Avatar for AbhikGhosh
0
7K
Member Avatar for plobby

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 …

Member Avatar for kvprajapati
0
86
Member Avatar for dmanw100

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 …

Member Avatar for dmanw100
0
196
Member Avatar for rwildman23

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.

Member Avatar for rwildman23
0
145
Member Avatar for Alpdog14

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 = …

Member Avatar for BestJewSinceJC
0
11K
Member Avatar for mamameanslove

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 …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for jemz

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 …

Member Avatar for jemz
0
33
Member Avatar for jemz

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.

Member Avatar for thomas_naveen
0
117
Member Avatar for mamameanslove

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. …

Member Avatar for BestJewSinceJC
0
116
Member Avatar for kendaop

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 …

Member Avatar for JamesCherrill
0
151
Member Avatar for gunjannigam

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.

Member Avatar for gunjannigam
0
102
Member Avatar for purushoth123

kindly please tell me how to connect from java to ms access, sql,oracle and so etc . with example

Member Avatar for peter_budo
0
173
Member Avatar for Snowdiddy

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 …

Member Avatar for wee_shark
0
120
Member Avatar for bkafroboy69

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 …

Member Avatar for darkagn
0
99
Member Avatar for wee_shark

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 …

Member Avatar for wee_shark
0
94

The End.