36,051 Topics

Member Avatar for
Member Avatar for purpleturtle
Member Avatar for masijade
-1
53
Member Avatar for guerrund

I need to know how to do the following: Allow for editing and Allow for searching by state or by any other options This is what I have so far: [CODE] import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; public class AddressBook extends JFrame { // Specify the size of …

Member Avatar for masijade
0
162
Member Avatar for nola_Coder

I'm needing to evaluate string infix equations and transform them to postfix equations. I'm following the info here: [url]http://scriptasylum.com/tutorials/infix_postfix/algorithms/infix-postfix/index.htm[/url] 1.) I'm confused by this line: "compare the precedence of the character with the element on top of the stack" It's asking me to compare the precedence of an operand to …

Member Avatar for nola_Coder
0
108
Member Avatar for nola_Coder

Hi... I'm a new user here. I've stumbled across this place on a couple occasions in the past, and it worked out to my advantage when I needed a little help with some coding assignments. My Data Structures class is working on stacks right now, and that is our current …

Member Avatar for nola_Coder
0
683
Member Avatar for poojasweetgirl

Hello. I wish to create a servlet which checks if the entered username and password are correct.If yes..message hello else go back to page showing error message. I know the settings for tomcat. i know the basic code for servlet.I also know i need http servlet .I will be using …

Member Avatar for poojasweetgirl
0
782
Member Avatar for Ranek

Hello Everyone, I'm having a bit of trouble seperating my user interface code in a main class from my logic code in another class. Basically i've put a while statement and some if statements in order to take input of a number from the user and decide which of two …

Member Avatar for Ranek
1
392
Member Avatar for meddlepal

I'm writing a program that transfers files around a network using UDP. One of the things I am trying to do is break down files into small byte arrays that can be put on packets and transferred. But it doesn't work... It doesn't seem to be reading the bytes correctly, …

Member Avatar for quuba
0
615
Member Avatar for topest1

Hello all, I am developing chat application(not applet) in java, I want it to be able to run over internet I have tried it in LAN with Socket programming I found something [URL="http://javaeye.wordpress.com/2008/05/04/clientserver-communication-using-tcp-sockets/"]here[/URL] It is working fine But how can i run it over internet:?: :confused: If i [COLOR="Red"]tcpserver.java[/COLOR](or tcpserver.class) …

Member Avatar for topest1
0
184
Member Avatar for majestic0110

Hi all, I hope you are well. I am trying to compile a java file using terminal in Ubuntu, but I am getting the following error message: [QUOTE]1. ERROR in StringComparisons.java (at line 20) System.out.printf("String a = %s String b = %s \n", a,b); [/QUOTE] As you can see, I …

Member Avatar for quuba
0
241
Member Avatar for mcek

I'm writing a program that will download pfd files and collate them. However the urls I get are a bit weird. They look like this: [code]http://links.ealert.nature.com/ctt?kn=105&m=34136651&r=MjA1NzczMzM4NgS2&b=0&j=NTkwOTY5NjQS1&mt=1&rt=0 [/code] I'm using URLConnection and BufferedInputStream, but no data is read from the stream (read() returns -1 at the first try). If they are …

Member Avatar for mcek
0
549
Member Avatar for nicklau

Html-structure [code] <html><head></head><body> <!-- START XOXO --> "lots of html and jsp stuff" <!-- STOP XOXO --> "file reading" </body> </html> [/code] The file reading code [code] <%@ page import="java.io.*" %> <% String line = ""; String file = request.getRequestURL().toString(); int print = 0; BufferedReader input = new BufferedReader(new FileReader(file)); …

Member Avatar for ejosiah
0
188
Member Avatar for ratnasatish

[CODE=java] how to merge two or more files (similar files) ex: two or mre pdf files, two or more xls files, two or more doc files. [/CODE]

Member Avatar for javaAddict
0
130
Member Avatar for valona

hi,,,may u help me solving this problem in java code?\ a)f(x) = xcosx-sinx/x-sinx b)Use 4 important first numbers to gain f (0.1) please help immediately,,,,,thnx

Member Avatar for musa_almanak
0
41
Member Avatar for gpremkum

Hi DaniWeb members:), I hope we could discuss about this matter and please do give advise, feedback or respond regarding my answer code below:icon_smile:. If the users enter x as 5, y as 6 the multiple table will be printed as below: 1*6=6 2*6=12 3*6=18 4*6=24 5*6=30 My answer code …

Member Avatar for jonelynne
0
90
Member Avatar for bruceaj

I have some classes that I use in most of my projects. [B]What [/B]and [B]how [/B]do I create something so the I can use them. A jar? An import? I'm using NetBeans as my IDE. Thanks for the help.

Member Avatar for masijade
0
231
Member Avatar for redrocket0274

So here is the code for my program FileMatch and FileMatchTest. The purpose of this program to read file oldmast.txt which contains account numbers with first and last name and their balance. The program will also read trans.txt which contains transaction information. If the account number from trans.txt matches with …

Member Avatar for BestJewSinceJC
0
161
Member Avatar for leverin4

How would one calculate the number of bytes of plaintext that could be encrypted as a single block given the key size? And how could you then calculate the number of bytes of cipher text that can be decrypted in a single block given the same key size because I …

Member Avatar for neilcoffey
0
4K
Member Avatar for bruceaj

I want to to do the following but can't figure out how to do it in Java. I retrieve information, including the primary key, from a database. Using this information, I load a comboBox. The user selects an item from the comboBox. Using that selection, I build an SQL join …

Member Avatar for bruceaj
0
120
Member Avatar for beshoyatef

Hi, Here i draw chess boardgame ,but i want when i pressed by mouse on any square , blue rectangle appear .. I did this but when i pressed on any square the black and white coloe disappear and not only the square which i pressed has blue rect but …

Member Avatar for beshoyatef
0
134
Member Avatar for iamsmooth

I know Netbeans has its own profiler, but for this assignment I have to use Jrat. I tried adding a command line argument -javaagent:shiftone-jrat.jar like you would put in the console, but it didn't work lol. I think I have the paths set up, I'm just not sure how to …

0
87
Member Avatar for nope3d

....can any one knows how to sort my class union.... ...since when i run it the output is correct but i need to sort it to feel much better...... here is my program.... this is my MAIN..... [CODE]public class FinalProjectBitString { public static void main(String[] args) { MySet universalSet = …

Member Avatar for masijade
0
66
Member Avatar for bobomonkey

Hi, I am writing a functional test automation script to automate the file upload feature of a web application. I am using a tool called selenium to operate on the browser. This tool however does not support clicking on the file upload control hence I want to do this operation …

-1
66
Member Avatar for tonief

I have this code i java I have class [CODE] class Author { String name,surname; public Author(String name,String surname) { this.name=name; this.surname=surname; } public String getAName() { return name; } public String getASurname() { return surname; } } [/CODE] And This code is OK; I have a button in jFrame …

Member Avatar for tonief
0
86
Member Avatar for 00darbo

I am new to programming Java, and cannot seem to find a simple answer to this on the discussions on how to go about this. Anybody?

Member Avatar for Zaad
0
70
Member Avatar for timon_zed

Hello good people of the world, I seem to be having a problem with how to make comparisons of dates using the Gregorian calendar objects. i want to find out if there is a way in which i can achieve it.the idea is make comparisons between the current date with …

Member Avatar for javaAddict
0
142
Member Avatar for 00darbo

Oddly, I am getting a similar problem, but mine seems not quite so simple: import NsccLibrary.*; import java.awt.Color; /** * This is a class in which tic-tac-toe boards will appear. * * @author Darby McShain * @version 1.0 */ public class TicTacToeFoSho{ private NsccWindow wind; /** * This creates the …

Member Avatar for javaAddict
-1
94
Member Avatar for morgoe

Is there a way to make an 'if' statement that applies to the whole code? I'm doing a user-input text-based program. And I basically want the user to be able to type 'quit' at any time, and that'll end the program. But I don't really want to have [CODE] if …

Member Avatar for javaAddict
0
139
Member Avatar for EddieC

One way to become the "ultimate" of something is to simply declare it. JetBrains, maker of the IntelliJ IDEA Java IDE, on Thursday began previewing [url=http://www.jetbrains.net/confluence/display/IDEADEV/Maia+EAP]IntelliJ IDEA Ultimate Edition[/url], the latest version of its commercial integrated development environment for Linux, Mac OS X and Windows. The "ultimate" designation is presumably …

Member Avatar for peter_budo
1
762
Member Avatar for iamsmooth

[code] public int peek () { if (empty() == true) { throw new EmptyStackException(); } return StackContents[top]; } [/code] So I have this piece of code in a class that implements a stack. The program works perfectly. However, when I use Junit to test it, I have this: [code] @Test …

Member Avatar for iamsmooth
0
124
Member Avatar for lllllIllIlllI

Hi, I have been trying to get a java program that draws a line directly on the screen. I have made ones that draw on JApplets and JFrame's but i cant work out how i can draw directly on the screen without having something in the way. I looked at …

Member Avatar for lllllIllIlllI
0
110
Member Avatar for hello214

hi, I'm trying to do my decimal to the nearest hundreths, i've tried using number format and printf but i couldn't do it. Anybody can help me with this: here is my program float grossPay = (calcGross(nHrsWrkd, hrlyRate)); float netPay = (calcTaxes (calcGross (nHrsWrkd, hrlyRate))); System.out.print("\nTaxes Withheld - $" + …

Member Avatar for javaAddict
0
168
Member Avatar for ice_cool

Hello, I have to cycle an image colors (specifically RGB) and i would like to know if Im on the right track here. Im also using 2-dimensional arrays. [ICODE] public void cycleColors() { Color red[][] = new Color[height][width]; Color blue[][] = new Color[height][width]; Color green[][] = new Color[height][width]; for (int …

0
64
Member Avatar for Superfat

Ok, i have been working on a simplistic game for about an hour now. This is what i have so far: [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Game extends JApplet { private int APPLET_WIDTH = 500, APPLET_HEIGHT= 100; private int money; private int owned; private JLabel labelMoney; private …

Member Avatar for VernonDozier
0
12K
Member Avatar for ibhome

I am writing integers from 1-100 into a file separated by commas. I need to know how to read in a "," into a file and print it out again. Below the code is sample output after execution of the code. The comma is not output correctly. I know it …

Member Avatar for ibhome
0
199
Member Avatar for gibson.nathan

what i am trying to do is to read this data in from a file, [CODE]1980 Aug 945 100 Allen 1983 Aug 962 100 Alicia 1984 Sep 949 100 Diana 1985 Jul 1002 65 Bob 1985 Aug 987 80 Danny 1985 Sep 959 100 Elena 1985 Sep 942 90 Gloria …

Member Avatar for VernonDozier
0
135
Member Avatar for nicolek808

I am having trouble with stacks and infix and post fix this is my error: [COLOR="red"]Reading from file "input16.txt": Infix expression = (5) Exception in thread "main" java.util.EmptyStackException at ArrayStack.pop(ArrayStack.java:51) at test.infixToPostfix(test.java:140) at test.displayArray(test.java:87) at test.main(test.java:53)[/COLOR] this is the txt file: (5) (1+1) ((9/3)-2) (9-(3/2)) (1+(4-(9*(6/(5%7))))) ((1+4)-(((9*6)/5)%7)) (((1+(4-9))*6)/(5%7)) ((1+(2-3)) (1+(2-3))) …

Member Avatar for ejosiah
0
2K
Member Avatar for jooa

Hi, I am trying to convert an image into grey scale. I can do this using a buffered image however the image type I have is Image. As you can see in the code below I try to cast the Image to a BufferedImage, apply the greyscale then cast is …

Member Avatar for asimKhatri
0
369
Member Avatar for wewehalim

Hi, this is my final project. I have generated an xml string, this is my code: [code]import java.io.StringReader; import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.CharacterData; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; <%@ page import="javax.xml.parsers.*" %> <%@ page import="org.w3c.dom.*" %> <%@ page import="java.io.*" %> <%@page import="recipe.*" …

Member Avatar for vishugs
0
402
Member Avatar for pwk064

Here is my Main method - calling Display. I am getting an error message, I don't know what I am missing. Any suggestions? public class Student { private int studentID; private double studentGPA; public Student() { studentID=100; studentGPA=3.0; } public Student(int id, double gpa) { studentID=id; studentGPA=gpa; } public void …

Member Avatar for masijade
-1
2K
Member Avatar for priyapratheep

Hi friends, I am new bie to programming.This is my first project.so the tecnical terms i am not familier. I am doing one small project with Eclipse Europa,jsp , EJB. with XDoclet, weblogic server I first created all my jsp files as one project.Then i created one enterprise application project …

Member Avatar for peter_budo
0
176
Member Avatar for pwk064

Here is my Main method - calling Display. I am getting an error message, I don't know what I am missing. Any suggestions? (error message below the code) public class DisplayStudent { public static void main(String[] args) { Student IDNGPA = new Student(); IDNGPA.Display(); } } Error message: DisplayStudent.java:11: Display(int,double) …

Member Avatar for peter_budo
0
96
Member Avatar for warbird43

Hi Everybody, Kindly justify which compiler/IDE for Java is the best. i vote for JCreator!

Member Avatar for peter_budo
-2
220
Member Avatar for TigerGirl

Hi. I have a recursive public static method search that takes a Tree node (any arbitrary binary tree, not necessarily a search tree) and returns whether or not that tree satisfies the order property for a binary search tree. So, my method is [CODE]public static boolean search(TN t) { if …

Member Avatar for TigerGirl
0
206
Member Avatar for bentlogic

Hi Java Developers, wondering if someone can point out why references to 'Student' (successfully compiled java class) in my ValidRecords.java source file don't seem to resolve at compile time? It's important to say that ANY and ALL references to Student object from inside ValidRecords.java don't resolve... not just the one …

Member Avatar for peter_budo
0
347
Member Avatar for nihao
Member Avatar for icke2433

alright ive been banging my head against a wall for three hours and i give up does anyone have a clue? the what im supposed to do is write a method named lotsOfStars that will accept two integers: the first integer indicates the number of lines to print, the second …

Member Avatar for petrisal
0
105
Member Avatar for fareast87

Hello everyone. If we open the jpg file with notepad, we can see some text or gibberish that doesn't give us any meaning. How do I append some text (ie password hash) to it using Java? I'm attaching a password hash to the jpg file. Hope that anyone reading this …

Member Avatar for fareast87
0
93
Member Avatar for fareast87

Hi everyone. I'm going to read a content of a jpg file using java.io.FileReader. I'm successfully read the whole content of it. But the problem is, I want to only read the last 32 digit hexadecimal number which is MD5 hash I save earlier. How am i suppose to do?

Member Avatar for fareast87
0
105
Member Avatar for temsuimsong
Member Avatar for peter_budo
0
87
Member Avatar for azwraith69

Hello... This is my naval battle game so far.. Just search i t if you're unfamiliar with the game it is only player vs computer.. can you adjust/fix my code so that: -the player is able to place his ships by means of dragging the JLabel ships at the left …

0
769

The End.