31,002 Topics

Member Avatar for
Member Avatar for bluedonutblueyedangel

I'm currently working on a homework assignment in one of my classes, and I'm having some trouble with it. I am supposed to make a multithreaded messaging program that allows users to connect using both TCP and UDP. The messaging program works perfectly when TCP is selected. However, I do …

Member Avatar for nandosss
0
331
Member Avatar for thorin

hi, everyone I am a Java newbie. I have followed a bunch of tutorials and examples from the web but they all failed miserably at teaching me how to properly apply this library: com.google.gson. First how do I receive properly in the java servlet a json request that has been …

Member Avatar for peter_budo
0
481
Member Avatar for daniel_14

Hello Everyone, I am having trouble getting a display of my program on the JTextArea "DisplayWindow". My code works and compiles but i do not know how to transfer the program to run on the GUI. It is really simple and I just want it to display and accept the …

Member Avatar for JamesCherrill
0
202
Member Avatar for albedini

I'm new and trying to draw a table type where I can place scores inside like 5; A B C 1 5//this is where it all falls apart 2 3 I have this so far but not working; public class Table3 { static int[][] list = new int[4][4]; //private char …

Member Avatar for JamesCherrill
0
258
Member Avatar for SMYussef

Dear all, I have a program to code which would take several lines of input from user (a fruit name, it's price per kg and the number of kgs sold). Each seperated by a space. It would then output the total money made and the name of the fruit that …

Member Avatar for stultuske
0
100
Member Avatar for Pobunjenik

I've got a JTable called chances_T full of doubles ranging from 0 to 100. I'm trying to set the background color of each cell based on the cell's value. So I built a custom cell renderer: class CustomRenderer extends DefaultTableCellRenderer { @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, …

Member Avatar for mKorbel
0
451
Member Avatar for <M/>

I am trying to cut the decimal off the output of this small code: import java.util.Scanner; public class Distance { public static void main(String[] args) { java.util.Scanner in = new java.util.Scanner( System.in ); double x1 = in.nextDouble(); double y1 = in.nextDouble(); double x2 = in.nextDouble(); double y2 = in.nextDouble(); double …

Member Avatar for old_apache
0
4K
Member Avatar for Derek_4

I am trying to set the boolean newEnergy to true only when the item is found. However, it is true at the beginning of the game and remains true until the command 'use' is used. Is there anyway to set newEnergy = true only when the item is found or …

Member Avatar for JamesCherrill
0
111
Member Avatar for Zubi0777

public void printmembersdetails() { System.out.printin(member.FirstName = firstname); System.out.printin(member.LastName = lastname); System.out.printin(member.IDNumber = IDnumber); System.out.printin(members.PhoneNumber = PhoneNumber); } System.out.printin(member.FirstName = firstname); System.out.printin(member.LastName = lastname); System.out.printin(member.IDNumber = IDnumber); System.out.printin(members.PhoneNumber = PhoneNumber); } is this right

Member Avatar for JamesCherrill
0
125
Member Avatar for StephenopolousINC

Hello I am trying to create a class that called Lootable and create subclasses such as trunk, locker, etc. that will contain items that can be looted, they will inherit their lootability from the Lootable class. I am thinking of using the ArrayList for this. I have thought of different …

Member Avatar for StephenopolousINC
0
924
Member Avatar for sk8ergirl

I've been trying to do this for the past two hours I have object of type PersonTest I managed to save the data ,but I'm not sure if it correct or not becouse I still can't read the file. I want to read and write using java Object Stream this …

Member Avatar for JamesCherrill
0
237
Member Avatar for Thirumuruganp
Member Avatar for sk8ergirl

I'm trying to creat simple seating for movie I have the seats as buttons when the user click btnOne then the background change to red if the user click the button again it will chnage to gray I've managed to change the color to red when it clicked using actionpreformed …

Member Avatar for softswing
0
118
Member Avatar for Ritesh_4

Hello Anyone can help me derive a validation for French phone numbers, given the following: String (max 255 chars) French telephone formats (0123456789, +33123456789, 0033123456789) T.I.A.

Member Avatar for Ritesh_4
0
135
Member Avatar for sk8ergirl

Hi, I've done with my project and the instructor said that the file should be excutable file how can I run my project wothput netbean .. I'm using macbook

Member Avatar for JamesCherrill
0
268
Member Avatar for Derek_4

I am trying to add an item to a game that will "float" a player into the correct room. The code below is where the boat is added to a room and the the boolean newBoat is set to true: Item boat = new Item(" A boat to help you …

Member Avatar for JamesCherrill
0
119
Member Avatar for Necrozze

Hi, I need to make a program that can count and solve basic math problems (addition, subtraction) with natural integers using strings. I'm not aloved to use parseInt so thats basicly where my world started to fall apart... Would realy appreciate if someone could help me with this. The code …

Member Avatar for Necrozze
0
356
Member Avatar for Shari_1

I'm not sure whether my title is clear enough, a bit hard for me to explain. Basically, I have this card abstract class. I also have a CreditCard subclass. In my CardSystem, I have different methods. One of them is chargeCard. What it does is simple putting some cash on …

Member Avatar for JamesCherrill
0
182
Member Avatar for gurusingh

hi friends, I'm developing a desktop application in java. But i want to make this application in such a way so that this install on other PCs. But I don't know the procedure. Please help me with yours valuable experience. Thank You in advance.

Member Avatar for raza.8590988
0
219
Member Avatar for SirDK

Hi Guys, Which language would be best for building utility applications for windows?(Tune-Up,Advanced System Care,CCleaner etc.) I'm inspired by the visual display of those programs.I'm currently learning VB.NET and I've beginners knowledge in C++ but I find it too difficult. Note : I'm a professional web designer.

Member Avatar for Banfa
0
289
Member Avatar for SMYussef

Dear all, I am trying to write a code that would take in an array of numbers(salaries) and then calculating the mean and standard deviance. The number of salaries is first asked from the user, therefore the number of elements in the array is not predefined. I have written the …

Member Avatar for SMYussef
0
1K
Member Avatar for Pobunjenik

Hello dear codegurus! I've been working on a pet project of mine for 3 weeks now, and I think it is ready to be released into the open! However, just for cosmetic purposes, I would **LOVE** to add an icon (both for the application and in the upper left corner …

Member Avatar for Pobunjenik
0
320
Member Avatar for cool_zephyr

i have a simple note and images storing java program that stores data into the server..i'm confused about what to use for building the server..should the server be built using sockets?? or which listens for http requests (the client sends json data)?? could anyone please tell me which one would …

Member Avatar for cool_zephyr
1
293
Member Avatar for shivakr

hi... i am trying to deploy my ejb file which i learned from youtube videos... so i go an Execption while running my clientEjb code.. it is as follows while running my client "HWorldClient"... E:\ejbDemo>java HWorldClient Exception in thread "main" java.lang.NoClassDefFoundError: HWorldClient (wrong name: part1/HWorldClient) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:502) …

Member Avatar for shivakr
0
119
Member Avatar for Start4me

How to give user the ability to set the decimal format rounding to whichever s/he prefers. I know that the users input can be gained by the code double decimalRoundTo; Scanner input = new Scanner(System.in); out.print(" Enter the number of decimal places you want to round to "); decimalRoundTo = …

Member Avatar for Start4me
0
2K
Member Avatar for murali2489

Hi Team, I have written a Sample Code in which I cast SubClass reference to point to SuperClass Object. It behaves like a SuperClass reference ( I mean when i try to use Methods which are not in SuperClass,it throws error so it means it is an instance of superclass) …

Member Avatar for murali2489
0
172
Member Avatar for ObSys

Ok so I'm writing a program that outputs text to a file. Currently, I am writing it to a .TXT file for ease and convenience. Ideally, I would like to output some of the information so that it is formatted with Italics. I'm thinking that using a RTF file would …

Member Avatar for JamesCherrill
0
276
Member Avatar for rovastola

I'm trying to code an array that will make user print in 125 digits and then add the sum of it, this works but im trying to make the message like: Please enter digit : 1 please enter digit : 2 Please enter digit : 3 ... Do i have …

Member Avatar for Heanre
0
165
Member Avatar for cool_zephyr

i want to develop a simple download manager..i have seen download managers downloading a file..but they have multiple download points e.g. suppose i have a file like this on a web server ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| download points : 1 2 3 4 5 they are downloading from all the points 1,2,3,4,5 simultaneously..i'm …

Member Avatar for pritaeas
0
238
Member Avatar for tyler.dahle

package hw3.categories; import java.util.ArrayList; import hw3.DiceGroup; import hw3.api.IScoreCategory; /** * Scoring category for a yahtzee. A DiceGroup * with N dice satisfies this category only if all N * values are the same. For a dice group that satisfies * this category, the score is a fixed value specified in …

Member Avatar for JamesCherrill
0
224

The End.