32,204 Topics

Member Avatar for
Member Avatar for shiva7892

print the pattern 1 1 1 1 1 1 2 2 2 1 1 2 3 2 1 1 2 3 2 1 1 2 2 2 1 1 1 1 1 1

Member Avatar for JamesCherrill
0
68
Member Avatar for BleepyE

Im coding my first Java applet for a University project and im having issues. Im in the process of coding a search and information function. When the user clicks anywhere in the applet a black circle appears under the cursor, when they then press the information button, information about that …

Member Avatar for BleepyE
0
129
Member Avatar for elsiekins

Hello, Unforunatly had to replace my hard drive on my laptop so having to start from scratch, i already had eclipse installed, so when i went to reinstall, downloaded JRE and JDK and 32bit eclipse (my machine is 32bit vista) but i get the error message [I]"A java Runtime Environment …

Member Avatar for ejosiah
0
148
Member Avatar for mpound

Sorry to be a major pain in the ass. Im new to java and trying to figure out what to put in the path under Enviromental Variables. Heres the location of my javac. C:\Program Files\Java\jdk1.7.0_03\bin What would i write exactly in the Path location? Regards, Matthew ;)

Member Avatar for mpound
0
129
Member Avatar for kris222

so this is what the output should be: A b C d E f G h I j K l M n O p Q r S t U v W x Y z heres what ive done so far class za { public static void main(String[]args) { String x="abcdefghijklmnopqrstuvwxyz"; …

Member Avatar for stultuske
0
145
Member Avatar for kris222

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); } } }

Member Avatar for stultuske
0
109
Member Avatar for Vampiricx3

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 …

Member Avatar for DavidKroukamp
0
163
Member Avatar for WigglesMcMuffin

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 …

Member Avatar for DavidKroukamp
0
215
Member Avatar for Chario0z

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 …

Member Avatar for JamesCherrill
0
232
Member Avatar for Valiantangel

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 …

Member Avatar for Valiantangel
0
106
Member Avatar for SasseMan

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 …

Member Avatar for SasseMan
0
215
Member Avatar for jimoaks

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 …

Member Avatar for stultuske
0
223
Member Avatar for mydreamgirl

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 …

Member Avatar for JamesCherrill
0
105
Member Avatar for cecsFTL

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 …

0
113
Member Avatar for glebovg

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 …

Member Avatar for zeroliken
0
262
Member Avatar for AmericanRogue

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 …

Member Avatar for kiail
0
1K
Member Avatar for bearcoyote1

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 …

Member Avatar for zeroliken
0
173
Member Avatar for BLY

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 …

Member Avatar for stultuske
0
241
Member Avatar for johndoe444

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 …

Member Avatar for PoonamV
0
1K
Member Avatar for jimoaks

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. …

Member Avatar for stultuske
0
204
Member Avatar for userct

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 …

Member Avatar for userct
0
234
Member Avatar for gedas

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 …

Member Avatar for NormR1
0
215
Member Avatar for Murphyv10

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 = " …

Member Avatar for stultuske
0
104
Member Avatar for javaprog200

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; …

Member Avatar for javaprog200
0
2K
Member Avatar for shean1488

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] …

Member Avatar for shean1488
0
133
Member Avatar for nidheeshkumar.r

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) …

Member Avatar for nidheeshkumar.r
0
428
Member Avatar for loserspearl

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) …

Member Avatar for loserspearl
0
177
Member Avatar for sonicx2218

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, …

Member Avatar for sonicx2218
0
149
Member Avatar for choat

Hi everyone, I develop application using Java-RMI, and I want to run as XHTML web page, help me please, thank you?

Member Avatar for choat
0
108
Member Avatar for MsBear92

[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 …

Member Avatar for NormR1
0
387

The End.