31,001 Topics

Member Avatar for
Member Avatar for Oregand

Hi guys, This week Ive been wrecking my head trying to write a code to run the following program: This program must test the dice 50 times. Then the results will be recorded and summarised. For each number (1 to 6), the program will print the most times that number …

Member Avatar for kramerd
0
118
Member Avatar for LianaN

Hello! I have the problem with my program visualization at different computers (but the same OS). Below you may see some code pieces related to creating the user interface. Everything is ok with this code at my computer. But I cannot understand why it produces different layouts at some other …

Member Avatar for LianaN
0
163
Member Avatar for kezkez

Currently trying to understand why this intersection method doesn't work properly, I think the problem is the if statement line but not sure if the problem solely lies there. I've included the necessary files to make my question clearer. The setIntersection method is part of the ArraySet class. The main …

Member Avatar for kezkez
0
176
Member Avatar for Xufyan

i want to make a calculator in which a user allowed to input two numbers in text fieldand on pressing the particular operation button the operation performed.but how could i restrict user to input only numbers and no strings ?? [CODE] import java.awt.*; import java.awt.event.*; import java.applet.*; public class calsc …

Member Avatar for ajst
0
1K
Member Avatar for Xufyan

what does it mean , use printf in JNI from C ??? i searched alot and found this, [url]http://java.sun.com/docs/books/jni/html/start.html[/url] but didn't find the specific answer :( i need the answer by tomorrow !:( help!

Member Avatar for masijade
0
728
Member Avatar for plasticfood

[CODE]else if(choice == 3){ System.out.println("what is your name? "); String name = kb.nextLine(); boolean x = Member.checkMember(name); System.out.println(x); } [/CODE] when i run this, it prints "what is your name?" and instead of waiting for me type in something, it just skips that part and go ahead and prints x. …

Member Avatar for javaAddict
0
113
Member Avatar for CF019

This probably wasn't clear from the initial prompt, but this is a multi part question I am trying to write a program that will scan what is being typed [not only into Eclipse, but into word or in a browser or whatever] My purpose for doing this is something along …

Member Avatar for peter_budo
-1
145
Member Avatar for Abdel_eid

hey guys , i had a problem with classes and objects , i need to get the class name form a text file for example and open an object from that class , is that possible if so how can i do it . the object parameters i can send …

Member Avatar for JamesCherrill
0
123
Member Avatar for nikita.chandra

Hi all! anyone can please tell me how to retrieve and display a blob data (which is a html page) which is stored in MySql databae by using JDBC on a jsp page Thanks.

Member Avatar for masijade
0
66
Member Avatar for Xeros606

I know that it's possible to "force" a class to have a certain function through interfaces, but is there any way to "force" a class to have and assign certain variables? Also, is there way to "force" a class to assign inherited variables?

Member Avatar for apines
0
107
Member Avatar for JuanKawada

I've been driving myself crazy with something I originally thought would be incredibly simple. Here's a really simple example of what I'm trying to accomplish: I have a picture sized 800x530, all I need to do is center this picture in a new image that is 800x800 with a black …

Member Avatar for JuanKawada
0
119
Member Avatar for eman 22

I know that multithreads in java allows me do multi tasks in the same time, but in the following code I'm not make a sense that the three threads done in the same time [CODE]public class myThreads { public static void main(String [] args) { System.out.println("Begin main Function"); mThread Thread_One …

Member Avatar for apines
0
158
Member Avatar for sciwizeh

Hi, it's been a long time since I've had a problem worthy of this forum, but I've got a real stumper. I've got some sockets, and after running through a get (through print writer sending a command, then an ObjectInputStream recieving an object) from the server code once, and trying …

0
68
Member Avatar for Areint

Hello, I'm having some problems creating an executable jar. I have written all my code in Eclipse and am able to run the program in it, but I cannot create a jar that runs it successfully and I cannot use Eclipse to export a jar that does it either. Here …

0
38
Member Avatar for Kremlan

I'm supposed to modify this method ([url]http://pastebin.com/6xF1pN51[/url]) to this (translated): "A faster algorithm to compute the average can be done by looping through the entire image in two passes in each session and make a one-dimensional mean value. In the first pass compute the mean value of the y-axis (one …

Member Avatar for quuba
0
142
Member Avatar for XxPKMNxX

I have written a program to create a 4x4 grid Sudoku style. The numbers for the puzzle are read from a file and placed in the puzzle. As you can see, i have assigned the first numbers 'a' and the second 'b' etc However, i can not access the a,b,c,d …

Member Avatar for XxPKMNxX
0
134
Member Avatar for sciprog1

Hello, How do I send a class (that extends from JFrame) back and forth between Client and Server? I would grateful for any pseudocode. Thank you!

Member Avatar for sciprog1
0
278
Member Avatar for hatux

Hello! I am facing a problem over and would like to ask if anyone knows the solution. On the following code i am looping files for sentences and then words. If a specific word is found i would like to store a String with the specific phrase. In example word[x-3] …

Member Avatar for jon.kiparsky
0
81
Member Avatar for Yutxz

Alright, this is a school assignment. Unfortunately, we were given about a paragraph of info on apps so I'm not sure what I'm doing wrong. I know it's a pretty random app, but these are the elements that she wanted. My problem is that it runs infinitely when I run …

Member Avatar for JamesCherrill
0
103
Member Avatar for bogun81

I need to provide web user interface... When client choose search option I want to call method which runs on remote cluster. So I need to use apache tomcat which runs on my localhost for servlet implemenation. From servlet I want to make RMI communication towards cluster machine and then …

0
45
Member Avatar for bleedi

Hi! I'm building a program which connects to a MySQL server. The program saves the server passwords in SHA format. There's one class responsible for converting and checking the passwords, and another one for DB connection. Now, when the user starts the program, (s)he types in the username and password. …

Member Avatar for bleedi
0
1K
Member Avatar for Mengha

Could you please show me a very small program with the explanation how the data can be passed between classes. I said very small program (as small as you can) because I just started in Java and if the program is big I'll get lost !!! I'm a bit confused …

Member Avatar for kramerd
0
6K
Member Avatar for Member 784374

Hi all, I was wondering if any of you could tell me how to convert a date format that is being returned in my XML. The element content is being returned as a string of form "2010-11-16T09:00:00Z". The XML is a copy of some metadata of an object in my …

Member Avatar for JamesCherrill
0
90
Member Avatar for gedas

hey guys, i am working on coordinates in one program and there is a line such as this one: [CODE]int xx =Math.round((int) getWidth() * 100 / 768);[/CODE] can somebody tell me what calculation is actually taken before the value is set to int xx thanks a lot for any suggestions

Member Avatar for gedas
0
150
Member Avatar for Codeslinger

/*THE OUTPUT SHOULD BE LIKE THIS: 2 4 6 8 10 - 30 //gets the sum of first column 12 14 16 18 20 - 60 //gets the sum of second column 1 2 3 4 5 - 15 //gets the sum of third column 6 5 4 3 2 …

Member Avatar for apines
0
91
Member Avatar for Monkey-huh?

[CODE]import java.util.*; public class Sort { public static void main(String[] args) { //driver method int[] array = new int[10]; System.out.println("Please enter ten integers"); insertionSort(array); } public static void insertionSort(int[] array) { Scanner kybd = new Scanner(System.in); int min, temp, n = array.length; for (int i = 0; i < n; …

Member Avatar for masijade
0
101
Member Avatar for serph09

Edit: Oh, nvm. I just redid the code and figured out how to write the tester class. Sorry guys for the trouble:( This thread can be deleted. So I have this code (not all was written by me). But I don't know how to start writing a tester class for …

Member Avatar for javaAddict
0
163
Member Avatar for rony

Hiya, I am using following Java file which creates a GUI, in the input field if i put any character why dont I see the JOptionPane.showMessageDialog pop up window as mentioned in the code? Any clues? Thx Rony //import statements import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.text.DecimalFormat; …

Member Avatar for javaAddict
0
744
Member Avatar for blknmld69

I would like to know how to take a selected Item string ("Allen Hall: $1,500 per semester") from one combobox and another selected Item string ("7 meals per week: $650 per semester") from another combobox and have the output to be ($2,150) the total of the two strings added together?

Member Avatar for javaAddict
0
103
Member Avatar for soteri0s

Hello everyone, I know this question has been asked before but it is possible to write a keylogger in java? Before assumptions are made I'm not trying to hack anyone or do anything illegal. I simply have a team project in my data structures class and I am an aspiring …

Member Avatar for peter_budo
0
235

The End.