32,199 Topics

Member Avatar for
Member Avatar for wobuaini

so the question is to print out strings that appear both in the two given lists, assume each list does not contain duplicates of the same word. so with the signiture of [B]public void intersect(Node n1,Node n2)[/B] and suppose we already have another method: [B]public boolean contains(Node n, String target)[/B] …

Member Avatar for hanvyj
0
126
Member Avatar for nikita.chandra

Hi! please help me for how can i scroll through database using JDBC. if i m creating 4 buttons say First,Last,Next,Previous. First button will take me to the first record of the database. Last button will take me to the last record of the database. Next and Previous will show …

Member Avatar for javaAddict
0
254
Member Avatar for mshauny

Hi I made a browser game with php and a little bit of java script, the ask a random question, then i dynamically load answers as image links, which the participant should select the correct one, if it is then he will go to the link the image href points …

0
68
Member Avatar for LordRazon

I need to make this a popup when a button is clicked. This is the code for the Button. [CODE] JButton moreOptionsButton = new JButton("More Options"); moreOptionsButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { timer.stop(); } } );[/CODE] I need this information to come up in a new window. …

Member Avatar for hanvyj
0
2K
Member Avatar for 123a

Hi, I basically have 1 arrayList with 10 elements. [CODE] //arraylist with10 elements private ArrayList<String> arrayList1 = new ArrayList<String>(); //arraylist with nothing in it. private ArrayList<String> arrayList2 = new ArrayList<String>(); public void copy() { Collections.copy(arrayList1, arrayList2); } //The code above will copy all the elements in the first arraylist to …

Member Avatar for JamesCherrill
0
101
Member Avatar for spades0001

I'm trying to make my for loop print ODD numbers and print their sum and average. Here's my code: public class Loop_For2 { public static void main (String[] args) { double sum = 0f; int ctr = 1, ctr2 = 0; for (;ctr<=10; ctr++, ctr2++) { System.out.println(ctr); sum += ctr; …

Member Avatar for tong1
0
128
Member Avatar for morancr

I'm not sure why it's not calculating right. When I enter a negative number, the if else statement or something does not register it's a negative number. There is a before and after, and you can see where it does not register negative numbers. Thanks in advance for your help! …

Member Avatar for morancr
0
159
Member Avatar for mcdonalds

Hi there, I'm having a weird error, When I click on my submit button my eventhandler that should be capturing the data from my JTextField is throwing an error : This is my first week using Java so I'm sorry if this is a newb thing. My Main function simple …

Member Avatar for Taywin
0
91
Member Avatar for insanely_sane

Been working on this for 2 hours non stop. Can't seem to figure out exactly what's the problem. Perhaps I'm taking a wrong approach to this problem. Right, I need to copy a singly linked list to another new list. Can use any method EXCEPT RECURSION. Here's the code so …

Member Avatar for Taywin
0
3K
Member Avatar for ceyesuma

Hello I just started working with JTabbedPane tabs. I have been using the index to navigate the pane. Now I add and remove tabs from the pane so clearly the index navigation is no good. Does anyone know some code for an easy solution for using the title or something …

Member Avatar for ceyesuma
0
97
Member Avatar for CompSci_Guy

I am good at created a little block diagram; however, I struggle with tracing these out and I have a midterm in a few hours. I am confused about all the casting and also about #4 and #7. I thought #4 would be a compiler error because the "Decared Type" …

Member Avatar for apines
0
962
Member Avatar for MAGall

Hi, Im new to java, mostly done networking in the past, im trying to create a program that will run a basic simulation of a number of heats for a 100m sprint. It mostly about the use of collections so nothing to complex but im completly lost. I've created a …

Member Avatar for MAGall
0
203
Member Avatar for Chalandria

Here is the start of my program. I am having a little trouble linking the farToCel/celToFar user defined methods with the final equations in the action statements. The output is whatever the user enters and 0 for "fah" and "cel". Example: displayTF.setText(inputTF.getText() + " Celsius is " + cel + …

Member Avatar for Chalandria
0
158
Member Avatar for sadia.ab

plz help.....in solving this problem While developing the Virtual University Learning Management System (LMS), there was a requirement stated that: “Students should be able to post their questions on MDB of LMS, so that it may help them to clarify their concepts in case of any confusion, after they have …

Member Avatar for Ezzaral
0
88
Member Avatar for Cuchara

So I have an array and I need to get the values of it that are larger than a set integer. It would be something like this apart from it doesn't work due to different data types. [code]myVariable = array[i]>otherVariable;[/code] where myVariable and otherVariable are integers. Any help?

Member Avatar for apines
0
81
Member Avatar for Khodz

Hello all, This is a very simplistic simulation but i'm hoping to show bacterial growth using this simple piece of code. [CODE]public class Bacteria { boolean living; Bacteria x; int population; public void spawn() { living = true; try{ Thread.sleep(2000); } catch (InterruptedException e ) {} Fission(); try{ Thread.sleep(100000); } …

Member Avatar for Khodz
0
622
Member Avatar for soccer13

Is there no such thing as hasNextChar? I'm trying to make a program to figure out a grade point average, and a solution I've come up with to deal with the +/- is to assign it as a char and give it a value from there, but I run into …

Member Avatar for apines
0
8K
Member Avatar for spades0001

I made a flowchart that will print counting numbers 1-10 automatically, and I'm supposed to print their sum and average at the end. Now, I have to convert the flowchart into three Java programs: For, While, DoWhile. I'm having a bit of a problem on the flowchart and the programs. …

Member Avatar for apines
0
202
Member Avatar for nipponsahore

Hey .. Everyone ... I'm now to java .. I'm trying to figure out .. how everything fits together .. well .. i have a project that I'm working on .. .. basically it a type of quiz working on java .. where a user takes a simple MCQ quiz …

Member Avatar for nipponsahore
0
179
Member Avatar for nipponsahore

Thank You .. EveryBody .. for Your Support .. Finally Got my Project Working again .. Now.. Im facing Only 1 Problem .. The JRadioButtons .. Remain selected even when I get to the next Question .. the Previous selection .. remains .. Selected.. any help how i can .. …

0
63
Member Avatar for serph09

The question is asking: A run is a sequence of adjacent repeated values. Write a program that generates a sequence of 20 random die tosses and that prints the die values, marking the runs by including them in parentheses, like this: 1 2 (5 5) 3 1 4 6 1 …

Member Avatar for kezkez
0
183
Member Avatar for AlvinLiu

[CODE]import java.io.FileReader; import java.io.IOException; import java.util.Scanner; import java.util.Arrays; import java.util.NoSuchElementException; public class ReservationBook { private Reservation[] data; public Reservation[] readFile(String filename) throws IOException { FileReader reader = new FileReader(filename); try { Scanner in = new Scanner(reader); boolean done = false; while(!done) { try { int numberofR = in.nextInt(); data = …

Member Avatar for Taywin
0
156
Member Avatar for wobuaini

I am sort of told that O(c^n) complexity could be the case of string permutations. but what is this specific 5^n? can anyone think of a simple algorithm with O(5^n)?thx

Member Avatar for Taywin
0
75
Member Avatar for o0oKodako0o

I have a ArrayList and JTable load Object from ArrayList to display on table. When i sort table by using method: [CODE]table.setAutoCreateRowSorter(true);[/CODE] by using that method, i can sort table by clicking on header of the column i want to sort! But after sort, the Object of row which i …

Member Avatar for o0oKodako0o
0
655
Member Avatar for de.ICeman

I have Brought a voucher For SUn JAva EXAM ,So where do u register for this exam ,cant find any links on SUN site And WHICH SUN JAVA EXAM should i give first SCJP OR some other???????????

Member Avatar for peter_budo
0
101
Member Avatar for plasticfood

here is some code from one class... [CODE]public boolean ticketStatus(){ if (fine > 0){ status = true; } else{ status = false; } return status; } [/CODE] and this is from another class... [CODE]public void getTicket(){ if (parkingticket.ticketStatus()){ toString(); } else{ System.out.println("you do not have a ticket. "); } } …

Member Avatar for Taywin
0
118
Member Avatar for sureshksk

Hi all, I am using java bean class in my web application(it is not extending servlet).My need is to get the context path of the application in that class.If yes how. I am using "./".It doesn't work. Please help me

Member Avatar for sureshksk
0
68
Member Avatar for atticusMom

Currently working on a project where we have a message board server. I've gotten most everything to work except my last part where we want an arrayList that returns Oldest Messages and one for newest messages. Here is what I have so far and have tweeked and commented out some …

Member Avatar for Taywin
0
118
Member Avatar for RaghadAsfar

Hi, I need to know if we can use the if satament with methods and how? and what is the illegal start of expression?

Member Avatar for javaAddict
0
78
Member Avatar for shamagantu

The problem: Java will not install on my laptop. My laptop was purchased a little over three and a half months ago. It is an eMachines 440-1394; Windows 7, two Gb RAM, 250 Gb HDD When I purchased the laptop, I was able to install openOffice (with Java? I am …

Member Avatar for apines
0
313

The End.