32,199 Topics
| |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 - $" + … | |
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 … | |
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 … | |
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 … | |
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 … | |
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))) … | |
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 … | |
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 … | |
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) … | |
Hi Everybody, Kindly justify which compiler/IDE for Java is the best. i vote for JCreator! | |
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 … | |
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 … | |
Hello all, How to make Java Application to a Windows Service? thx~ | |
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 … | |
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 … | |
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? | |
anyone please tell me where i can get mp3 player for motorola v3i. Thnks | |
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 … | |
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 … | |
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 … | |
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 { /** … | |
....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 … | |
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 … | |
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 … |
The End.