32,199 Topics

Member Avatar for
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
139
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
93
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
137
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
740
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
121
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
106
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
166
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
62
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
185
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
132
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
366
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 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
94
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
216
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
201
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
343
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
102
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
91
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
98
Member Avatar for temsuimsong
Member Avatar for peter_budo
0
84
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
764
Member Avatar for lllllIllIlllI

I am making a slider puzzle applet. And i have this problem when i display it as an applet my buttons do not seem to act the same was as they did before i made it into an applet by using a JApplet rather than a JFrame as my extension …

Member Avatar for lllllIllIlllI
0
117
Member Avatar for WarHammer91

I need to write a program that will print a calendar for any given month and year since January 1900. I don't think I can use any calendar utility. To be honest, I'm slaving my way through this, I don't really have any idea what I'm doing. Here's what I …

0
42
Member Avatar for Austinjs0102

Trying to make a simple english text calculator and i keep getting some errors. Here is what i have /* * A calculator that calculates your answer and outputs it i english. */ package Calc; /** * * @author Austin */ import java.text.*; import java.util.Scanner; public class Calc { /** …

Member Avatar for Grn Xtrm
0
152
Member Avatar for nope3d

....Can anyone knows how to put some functions that if I run my program, the menu will disable my logoff menu, Maintenance and emloyee and the auhtor.........but if i press my log in it will enables the log off menu, Maintenace and employee and the author itself.... then the log …

0
52
Member Avatar for _dragonwolf_

I am having an issue converting words into phonetic spellings. Example: userInput = apple / outResult = Alpha Papa Papa Lima Echo I can get my code to convert a single letter to its respective phonetic. I can also get it to split a string into separate characters. Here is …

Member Avatar for _dragonwolf_
0
2K
Member Avatar for catcoffee

Hi all! Сonditions of a problem: 1) in one form post info and upload file 2) validation only php without js 3) associated fields: if the value is not the same, we don't need to validate field 4) associated fields: if the value is the same, we need echo new …

Member Avatar for jomanlk
0
214

The End.