32,199 Topics
| |
Hey can someone help me with my java program you have to A-Z to Z-A here s what i ve done so far: class az { public static void main(String[]args)throws Exception { String x="abcdefghijklmnopqrstuvwxyz"; int ctr; for(ctr=1;ctr<=26;ctr++) { char z=x.charAt(26); System.out.print(z); } } } | |
Hey guys, I have the idea of creating a custom Java terminal, I know what I need to do for commands, etc, but I have no idea on how to style it like someone would with a UNIX terminal/Windows Command Prompt, or prompt it so that whenever a new line … | |
Hello, This isn't the typical "I wrote a heap sort that doesn't work, help me please" thread, instead, I'm one step before that. I'd really like to [B]understand[/B] the innards of a heap sort before I attempt to write one. I'd like to give it a go from scratch, or … | |
Hello, So I've got trouble with a program I'm working on. The program is supposed to register studends and teachers to a register, and when I close it, I want to save all data with DataInputStream/DataOutputStream. So when I open the program, I want to see what I've registered. It's … | |
Hi, Can anyone go through my code to brush it up?I got the correct output,printed below, but i need some polishing of the below loop assignment. 1.Should i be using 2 while loops? 2.Regarding the [B]output[/B]-How can i align the verticle columns and the output neatly. [ICODE]public class MK{ public … | |
Hi! I was wondering if there is a way to mock Date and Calendar objects for testing purposes. In other words I want to programatically be able to change what new Date() and new Calendar() etc. returns independent of the system date. Something like setting the date for the jvm … | |
So i dont know why i am getting this error, here are my 3 classes plus the tester edit: I get the null exception after i run the program, --------------------Configuration: <Default>-------------------- Exception in thread "main" java.lang.NullPointerException at University.offerCourse(University.java:35) at StudentCourseTestProgram.main(StudentCourseTestProgram.java:53) Process completed. [CODE]import java.util.*; public class Student { private String … | |
By running following code and I got following output: At begining of default constructor, theApplet.isDisplayable()=false Start Init here... At begining of init(), theApplet.isDisplayable()=true At begining of constructor, theApplet.isDisplayable()=false End Init... Two questions: 1. Does anybody know why isDisplayable() is changed without do anything on it? 2. Why does the JApplet … | |
Hello, I recently turned in this assignment and I didn't received full credit. He wrote "It could be better." I'm not sure what to change. Here's the assignment: Write your own driver for a stack class. Instantiate one stack container object. Your driver generate random strings (uppercase letters) to push … | |
| Can anyone help me with my homework? Create a Java class named ArrayTest with a method called arrayCombiner that creates three arrays of size 10. The first array should contain the values 1, 3, 5, 7, 9, 11, 13, 15, 17, and 19. The second array should contain the values … |
I'm trying to get a user to input a char and an int to create a box visual using that int. I tried to use Character.parseChar, and realized that wasn't possible. How can I get user input of a char value? Below is my code. [CODE] import java.io.*; public class … | |
import java.awt.*; import javax.swing.*; public class RandomCircles extends Canvas{ private static int delay; private static int numCircles; private static int frameSize; public static Graphics g; public void paint(Graphics g){ } public static void main(String args[]){ frameSize = 800; numCircles = 1; delay = 5; RandomCircles circles = new RandomCircles(); JFrame … | |
I'm trying to create a SimpleBirthDay calculator.The requirement is "program must use a Scanner class and JOptionPane class to capture input from user".But i'm having a problem on getting the messagedialogbox to show the result.I found out that using the Scanner class we gonna need to insert the data into … | |
Hi, I wrote this code as is from the JNDI tutorial from sun website. But I am getting this exception while running it: [CODE]import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.util.*; /** * Write a description of class FirstJndi here. * * @author (your name) * @version (a version number … | |
Hello. I have started writing a program that adds students and courses into a university. The problem I have is I keep getting "Student.java:62: cannot find symbol" errors, I looked at an example and I have it setup the same way so I don't know where I am going wrong. … | |
I need to modify this movies program so that way the DVDs will be sorted by title at all times (A first thru Z). I need to use Binary Search so I put a method in DVDCollection but I'm probably missing something or calling it incorrectly. The program needs to … | |
Hi guys, i have been having some problems parsing a list of strings. lets say i have a list that has the following strings [code] List<String> list = new ArrayList<String>(); list.add("Process A Started"); list.add("Process B Started"); list.add("Process B Finished"); list.add("Process A Started"); list.add("Process C Started"); list.add("Process D Started"); list.add("Process C … | |
Howdy all . Im doing a code for study but cant get it to compile any help would be greatly appreciated.. public class Flight { //instance variables private String flightNumber; private String day; private String destination; private int seatsBooked; private int numberOfSeats; // constructors public Flight() { this.flightNumber = " … | |
Hello, The following applet displays two .jpg files (ImageIcon objects - x and y) on a JPanel. I would like to display the second ImageIcon object (y) as transparent. Is that possible? Thank you! [CODE] import javax.swing.*; import java.awt.*; public class PicPanel extends JApplet { ImageIcon x, y; JPanel panel; … | |
Hi guys I have part of the code that looks something like this: [CODE] if(c1=='a') myStack.push(c1); else if(c1=='b') myStack.push(c1); else if(c1=='c') myStack.push(c1);[/CODE] I just want to ask is there any way to rewrite this code, to make it more compact something like [CODE]if(c1==('(a'||'b'||'c') // I know this doesn't work [/CODE] … | |
hey, im getting the exception [CODE]Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com.sun.media.jai.codec.SeekableStream at javax.media.jai.operator.BMPDescriptor.class$(BMPDescriptor.java:65) at javax.media.jai.operator.BMPDescriptor.<clinit>(BMPDescriptor.java:87) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:186) at javax.media.jai.RegistryFileParser.getInstance(RegistryFileParser.java:224) at javax.media.jai.RegistryFileParser.registerDescriptor(RegistryFileParser.java:360) at javax.media.jai.RegistryFileParser.parseFile(RegistryFileParser.java:295) at javax.media.jai.RegistryFileParser.loadOperationRegistry(RegistryFileParser.java:55) at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:369) at javax.media.jai.JAI.<clinit>(JAI.java:382) at cbir.window1.ColorHistogram.<init>(ColorHistogram.java:61) at cbir.window1.SearchWindow.jButton1ActionPerformed(SearchWindow.java:92) at cbir.window1.SearchWindow.access$000(SearchWindow.java:22) at cbir.window1.SearchWindow$1.actionPerformed(SearchWindow.java:47) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252) … | |
| Im working on a Search index that searches through files that you manually add to the index, I'm having trouble with my GUI right now. Never used any java IDE before and its giving some unfamiliar suggestions. Netbeans wanted to make my main class abstract (but for no reason stopped) … |
| Hey, I'm kinda crappy with arrays. [CODE] int [] myArray = new int[5]; myArray[0] = num1; // initialize # of cols myArray[1] = num2; // in each row myArray[2] = num3; myArray[3] = num4; myArray[4] = num5;[/CODE] I want to use a for statement, to add these 5 things together, … |
Hi everyone, I develop application using Java-RMI, and I want to run as XHTML web page, help me please, thank you? | |
[CODE]/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* * MainMenu.java * * Created on Feb 22, 2012, 7:28:37 PM */ package f1carracing; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JOptionPane; /** * * @author … | |
I have seen several posters asking for help on programs converting an Infix expression to a Postfix one. I have written a program to convert a simple Infix expression to a Postfix one so that people here can be directed towards some sample code from which they get the idea … | |
I have a project where we are calculating the cost of shipping a product from manufacturer to warehouse using North-west corner and also using another method to find the minimum cost to meet the demand. I am stuck on coding the minimum cost algorithm, I understand the minimum cost algorithm, … | |
Hi I wanted to add some some date comparison functions to some xslt. I thought since I have a custom myjs.js library loaded with a DoDebug function that simply returns a boolean True I could use the following but I get an "Unknown XSLT function Error". Is there a way … | |
hi , i want to ask if some one know how can i calculate number of variables or used variables in a java file? is there any way to do it? | |
please help me with my problem in JAVA PROGRAMMING: this the problem. Write a program that will ask a user to input his/her name and the number of quizes he/she would like to enter. The program will then ask for the scores for quizes and will display the total and … |
The End.