35,618 Topics

Member Avatar for
Member Avatar for abra_ka_dabra

How do i get the key of "tradeid3" ? Is there any inbuilt method that does it? import java.util.Map; import java.util.HashMap; import java.util.Iterator; public class abcd{ public static void main(String args[]){ Map m= new HashMap(); m.put("TRADEID1", "tradeid1"); m.put("TRADEID2", "tradeid2"); m.put("TRADEID3", "tradeid3"); } }

Member Avatar for stultuske
0
175
Member Avatar for ganges

Hi, what are the essential jar files for a hibernare 4.0 project kindly provide me the name of those jar files thanks in advance.

Member Avatar for stultuske
0
65
Member Avatar for trisha mehta

hello, i have to write a java code using socket programming to transfer all the files from one server to another server keeping the size of the files intact (i.e create a backup of the files in another server). i am new to socket programming. so i would really appreciate …

Member Avatar for trisha mehta
0
5K
Member Avatar for laguardian

Hey guys! I'm trying to create a program that first asks the user for an integer input *n*. The program will then ask the user for *n* Strings and store these in the array. This is what I have so far: public static void main (String args[]){ String[] strArray; int …

Member Avatar for stultuske
0
525
Member Avatar for CoilFyzx

Hello Good day. Here is the problem I am trying to solve. I have a table as seen below. ![232465554203149acd8363d3a4a127ae](/attachments/large/3/232465554203149acd8363d3a4a127ae.jpg "232465554203149acd8363d3a4a127ae") My GOAL: Columns A through G are going to be filled with integers. (I have already created an integer model so that these cells only take integers). As the …

Member Avatar for CoilFyzx
0
451
Member Avatar for poopuh

I've been asked to edit the code in this post http://www.daniweb.com/software-development/java/threads/455560/java-recursion-brute-force-sim so that it "Runs the function as a thread which wouldn’t then hang the program whilst it’s waiting for the result". I've looked it up, but I'm struggling to apply it to this program, any tips?

Member Avatar for JamesCherrill
0
642
Member Avatar for abra_ka_dabra

I am using the following code to write to the file out1.txt: try{ FileWriter fostream = new FileWriter("out1.txt"); BufferedWriter out = new BufferedWriter(fostream); out.write("jlsdfjdlsfhsdkjf"); out.close(); }catch (Exception e){ System.err.println("Error: " + e.getMessage()); } Now i want to write to multiple files in the same code (let us say 2 files). …

Member Avatar for JamesCherrill
0
6K
Member Avatar for sirlink99

Hello. I submitted [this](http://www.daniweb.com/software-development/java/threads/455615/java-decryption-problem) post a little while ago where I had problems with decrypting what I encrypted. Now my problem is that when I encrypt something and then decrypt it, the decryption works with txt files, but when I try to decrypt microsoft documents, then they will not open. …

Member Avatar for sirlink99
0
549
Member Avatar for hashim5003

I want to count the number of attempts the user tried to guess the correct guess. How would i do that? like I have thought of a number. Try to guess it Take a guess: 5 Your guess is higher than mine Take a guess: 3 Your guess is lower …

Member Avatar for hashim5003
0
4K
Member Avatar for cheesy_ninja45

I'm trying to make this work, and I keep getting errors, can someone fix it and show me what's wrong? I've been trying to fix this for a few days and I can't. Thanks in advance. import java.awt.*; import java.applet.*; import java.util.*; import java.awt.event.*; import javax.swing.*; public class FrameX extends …

Member Avatar for stultuske
0
228
Member Avatar for Violet_82

Hi chaps, I am looking for a not too difficult exercise which involves superclasses and subclasses (the java book I am reading doesn't really have any good one). So I was thinking about something like this: Create a superclass 2DimensionalShapes and 2 subclasses Rectangles and Triangles. I will then need …

Member Avatar for Violet_82
1
248
Member Avatar for modesto916

Hello, My teacher asked us to write a little O.S simulator, my group has to write the file system module. We are using contiguous block alocation for the files, we would like to represent the utilization of the blocks using a colored matrix, where the used blocks would be red …

Member Avatar for modesto916
0
144
Member Avatar for james12James12

Tryin to sort a search method for abit of code. Have an array list reading from a csv. Any help on how I can get a search method searching through and displaying onto a jTextArea? This is my code in my Gui public class DataGUI extends javax.swing.JFrame { public class …

Member Avatar for stultuske
0
300
Member Avatar for abra_ka_dabra

running 'java -version' on my cmd prompt gives me the version of my JRE but when i run my programs as 'javac abc.java' it says 'javac' is not recognised as an internal or external command, operable program or batch file. I have set the Path variable by appending C:\Program Files\Java\jre6\bin …

Member Avatar for JamesCherrill
0
348
Member Avatar for Jasonfran

Hello, I have created a GUI using the Netbeans GUI Builder and I have a JTextArea that I want to output to, but because I need to use threads I am doing a lot of processing in an external thread. I am having issues outputting data from the thread class …

Member Avatar for stultuske
0
2K
Member Avatar for Tango2010

Hi, I wonder if anyone can possibly help. I am trying to teach myself how to integrate a Java video into a Java GUI / Swing Application. I am pretty competent with building Java graphical user interfaces and the background Java application code, however I am puzzled with how difficult …

Member Avatar for nvrandow
0
479
Member Avatar for vongola.lee

Hey, Can i know how to do the throw and catch for my java code ? i need to create a OfferException class which allow a suitable error message to be specified when there is an error. this is my code.. public boolean makeOffer(int offerPrice) if (!super.getSaleStatus()) { System.out.println("Error - …

Member Avatar for peter_budo
0
144
Member Avatar for peter_budo

I have four JTextFields where user is allowed to enter only numbers. Question is how do I do this?

Member Avatar for JamesCherrill
0
9K
Member Avatar for Jasonfran

Hello, I am making an IRC application and I was wondering how I could make a simple event that gets called like onMessage() every time a IRC message comes through so I can then do something like this in my main class: public void onMessage(String message){ System.out.println(message); //or Handle commands …

Member Avatar for JamesCherrill
0
209
Member Avatar for timi_ca

Im new to java swing, and Ive got a little problem. So I've got a class Flight.java. In there I have a method displaySeat2D(). First I had this done with the scanner. Now I have to use swing. So basically I made text fields to take in number of rows …

Member Avatar for timi_ca
0
2K
Member Avatar for limaya

Write a java program to calculate and display the product of the odd integers between 0 and 50

Member Avatar for JamesCherrill
0
136
Member Avatar for somjit{}

can the members suggest some books/links that takes advantage of what i already know about oop (the basics , from java) and utilises it to make learning C# a faster process? perhaps i should have posted this on the C# forums , felt i should keep it here as my …

Member Avatar for somjit{}
0
251
Member Avatar for salomonsk8

Hello all, So I have been scouring the internet trying to find an answer to my question. I usually never have to post a question because someone somewhere has asked it, but I guess there is a first for everything. I am a VERY intro level, brand spankin new 'programmer' …

Member Avatar for salomonsk8
0
513
Member Avatar for s4ualex

Hi, This is Alex, After upoading the image, i dont want to store the image immediately, i need to display the image in confirmation page and the user is confimed i need to store it in physical location. i know how to store in physical location. but i dont know …

Member Avatar for Srujan1
0
247
Member Avatar for sciwizeh

Hello All, So I'm working on hand-coding a forum-like website, just for the experience, and I want to have a similar feature as you'll see above where a thread will have its ancestors linked: "Web Development > JSP > Parent traversal of tree-like Structure" I have several beans for different …

Member Avatar for sciwizeh
0
276
Member Avatar for abra_ka_dabra

In the code below, I am trying to convert the target[] strings to a given format in target1[] and then sorting them using bubble sort and store it in target2[] which is a date object array.. However, when the desirable format is "EEE MMM dd kk:mm:ss z yyyy", it is …

Member Avatar for JamesCherrill
0
255
Member Avatar for poopuh

Hey guys, I'm planning to develop a java web text editor which stores its entries on a MySQL database and is then private for every user. This is a learning curve for me and I will share all of my findings and such on here. Can anyone give me any …

Member Avatar for stultuske
0
257
Member Avatar for Mr.M

Hi DW I'm a VB.Net user and I have a project which I'm doing and the problem is that I didn't find the answer to my problem in VB.Net I found it in Java so now I'm forced to complete this project in java, I must say this is a …

Member Avatar for stultuske
0
225
Member Avatar for overwraith

Hello, I am working on a program, and I noticed that all my threads are starting and stopping in exactly the same order I put them in, and they are not trading places in the output, or mixing output like concurrent objects should. Here is my code: public class RaceHorseAppII …

Member Avatar for JamesCherrill
0
132
Member Avatar for willjohanz

1.A________ statement consists of a valid identifier 2.A__________ statement is used only in case of nested loops 3.The port number 555 describes ***port 555 ***all ports greater than or equal to 555 4.The ____ method of the signature class updates data by a byte 5.The _______ constructor creates a horinzontal …

Member Avatar for stultuske
-3
155

The End.