32,199 Topics

Member Avatar for
Member Avatar for ibthevivin

So let's take "banana", what happens when the program gets to if (ch <= 'd')? My understanding is the 'b' is < 'd' so it moves to the else. Am I wrong or right? If I'm right, then what happens at return 1 + g(s, index + 1); public class …

Member Avatar for ibthevivin
0
189
Member Avatar for cj122

import java.applet.Applet; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Image; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.util.Random; import javax.swing.JFrame; public class StartingPoint extends Applet implements Runnable, KeyListener{ public static void main(String[] args) { StartingPoint sp = new StartingPoint(); JFrame frame = new JFrame("My applet, as application"); frame.getContentPane().add(sp); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); sp.init(); sp.start(); frame.pack(); …

Member Avatar for NormR1
0
253
Member Avatar for hallepalle

Hi my name is Jakob and I'm new to programming. My project now is to make a game called Mastermind in Java Eclipse. Here is an explanation of what Mastermind is: [url]http://sv.wikipedia.org/wiki/Mastermind[/url] My game is going to be text-/number-based and it's just going to be able to run in the …

Member Avatar for NormR1
0
15K
Member Avatar for kedxu

**Background**: I have some experience in programming, but it's not a lot and not very good. I'm taking my first Java class this year, but because the pace is so slow I decided to just learn with the aid of the internet. This is how I have learned most of …

Member Avatar for kedxu
0
385
Member Avatar for sobias

Hi Guys, There's something bugging me in the past 2 days. In Doubly Linked Lists, when will a Node get comepletely deallocated? is it when both **Next** and **Previous** references points to **NULL**? forget about the class and the method **remove()** and such. Let me make an example so you …

Member Avatar for sobias
1
224
Member Avatar for lovebirds

hi , i am facing a problem with jlabel. i wanna check wether the values displayed in the label is 0 or not.but no coding seems to work. int a=Integer.parseInt(albl.getText()); if(a==0){ lbl.setText(""+"out of stock"); } else{ JDialog1.setVisible(true); }

Member Avatar for NormR1
0
36
Member Avatar for ObSys

Ok so im writing a small java application using Zellers Algorithm to work out the day of the week for a given date. I have never compiled a java program before because i'm still moderately new to the language and IDE's etc. I am using netbeans. I have tried to …

Member Avatar for NormR1
0
169
Member Avatar for FUTURECompEng

This was in the game development section and I think I accidently put it there (or an admin moved it, if so then next time can you let me know, thanks). So I am posting it here (java forum community is of higer quality when giving responses) , I hope …

0
199
Member Avatar for joshuathree

I am trying to cluster a sparse matrix with using K-means algorithm. I will use Apache mahout but I did not find any example about how can it be implement with Java. Is there any tutorial or function javadoc about it? I have tried KmeansDriver's run() function but I did …

0
98
Member Avatar for Morbs

I keep recieving an error on lines of code 77-80 and I'm not really sure what I'm doing wrong. They're all the same error and goes as follows: ----jGRASP exec: javac -g Program5.java Program5.java:72: error: cannot find symbol adultTickets = adultTicketPriceTextField.getText(); ^ symbol: variable adultTicketPriceTextField location: class Program5.buttonListener Program5.java:73: error: …

Member Avatar for Morbs
0
624
Member Avatar for jg1405

I am struggiling to correctly put together these two constructors, one adds an instance of an array class and the other searches for an int passed-in. public void Add(Appointment a) { Scanner s=null; for (int i=0; i<this.m_Appointment.length; i++) { m_Appointment[i]=a; a.Read(s); m_NumElements++; } } public Appointment Find(int appointmentId) { for …

Member Avatar for NormR1
0
155
Member Avatar for FUTURECompEng

I am going to be honest here, I am completley lost on trying to figure this out. I am trying to create a sudoku solver using sat4j for a 9x9 puzzle. I am trying to read a partially filled board and, by using a Satisability solver it finds a legal …

0
205
Member Avatar for jamesperkins0

Hi guys, so my task is as follows. A. Develop an application that reads your listings.txt file, analyzes the property listed per agent, and outputs a report to an agentreport.txt file. Your application should do the following: 1. Prompt the user for the name of the input file (listings.txt). 2. …

Member Avatar for jamesperkins0
0
466
Member Avatar for j.jroxs

my dillema is i dont fully understand this assignment. I also dont know if my array should be inside of class or inside of the void setString method. help import java.util.Arrays; class String { //data members private int SIZE = 25; private [] myString = new array[25]; public void setString( …

Member Avatar for NormR1
0
124
Member Avatar for adesexy

hi . i need help.You are asked to implement a set of programs to simulate a group of users being logged onto a computer network. Users may be added, deleted, modified, displayed and searched for at any time. A method to test whether a user’s name is a palindrome (a …

Member Avatar for JamesCherrill
0
72
Member Avatar for hwoarang69

public class J_01_FLOW_08 extends JApplet { JPanel p = new JPanel();//nedd a jpanel to add scroll String s_value[] = {"black","red","pink","yellow","blue","orange"}; DefaultListModel dlm = new DefaultListModel(); JList l_list = new JList(dlm); JScrollPane sp = new JScrollPane(l_list,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); JLabel l_label = new JLabel(); Container c; FlowLayout flow = new FlowLayout(); public void init() …

Member Avatar for hwoarang69
0
289
Member Avatar for apanimesh061

How can I extract the main classname of a java file ? I am doing this in php! I will read the whole java program as a string! Please help! <any_type/public/private/static> class **MainClass** { //Could be anything over here! public static void main(String[] args) { System.out.println("Hello World!"); } }

Member Avatar for AleMonteiro
0
110
Member Avatar for alikhandro

how can i implement a polynomial class using the doubly linked list data structure such that each node of the list holds the coeffient and the exponent of the term ?

Member Avatar for NormR1
0
312
Member Avatar for javaprog200

Hello, I am unable to register the right key event from this program. Besides setting the focus of JPanel to the KeyListener, I am not sure what else can be done. I will be grateful for any help. Thank you! import java.awt.*; import java.awt.event.KeyListener; import java.awt.event.*; import javax.swing.*; public class …

Member Avatar for javaprog200
0
250
Member Avatar for jamesperkins0

hi Guys, I am currently coding for a GUI based program that delivers the amount of time a tutor works in minutes and the amount they go paid total, giving them details on the amount of time work total, and wage per hour and if it is below, minimum, or …

Member Avatar for jamesperkins0
0
387
Member Avatar for shihab2555

Hi.I created a jtable and imported a table from mysql there.now i created 3 jtextfield and 1 jdatechooser.Now i want to see the value of any row in the jtextfield and and jdatechooser when a row is clicked.I created the following method for this.It worked for the textfield but didn't …

0
77
Member Avatar for JamesCherrill

I'm curious. Why is so much code in this forum formatted like this [CODE]if (something) { do something } else { do another thing }[/CODE] rather than [CODE]if (something) { do something } else { do another thing }[/CODE] The first version is harder to read and takes up more …

Member Avatar for JamesCherrill
0
375
Member Avatar for challarao

Hi all, A question asks me to write overloading functions to square,circle ,rectangle and triangle.... But since the square and circle have only one parameter I had to change the parameter of area of circle to double...... Is this the only way to accomplish this..... Are there any other ways …

Member Avatar for stultuske
0
197
Member Avatar for rahul.ch

import java.util.*; public class Elway { public static void main(String r[]) { ArrayList[] ls = new ArrayList[3]; for(int i=0; i<3; i++) { ls[i] = new ArrayList(); ls[i].add("a" + i); } Object o = ls; do3(ls); for(int i=0; i<3; i++) //insert code here } static Object do3(ArrayList[] a) { for(int i=0; …

Member Avatar for rahul.ch
0
289
Member Avatar for PriteshP23

I need your urgent help. Please help me to solve it out. Thanks a lot in advanced for your time. error: java.lang.StringIndexOutOfBoundsException: String index out of range: 150 Lines of code in this place there: if (text.length ()> 150) { text.replaceAll summary = ("<[^>] *>", ""). substring (0, 150) …

Member Avatar for PriteshP23
0
184
Member Avatar for Consuela94

Hey everyone, iv'e been working on a Hangman code for weeks for the beginning of a semester long portfolio, iv'e tried several codes, but no matter what i do i can't seem to make it work... The specifics for the program were: - Create a list of possible words called …

Member Avatar for Consuela94
0
5K
Member Avatar for Muzzla

Hi there, I've been trying for hours to get my Dijkstra algorithm to print the correct path. It collects the correct distance properly, but I just can't get it to print out the path of nodes that it uses! Any help would be great appreciated. 'route' is my string variable …

Member Avatar for NormR1
0
615
Member Avatar for Ubi2073

I've been doing this for the school assignment. So the whole idea of this program is to use random numbers to disguise a message by translating it into pairs of numbers; or to reveals messages by translating a series of pairs of numbers back in to the original characters. It …

Member Avatar for NormR1
0
294
Member Avatar for Lamirp

Hey guys and girls, first post here been reading for a few days but I am pretty new to java and I have to edit a class to import a file into an array. The class initially defined the array within itself. So I made my changes and I am …

Member Avatar for Lamirp
0
180
Member Avatar for alastair1008

basically my program runs like this 1. open up configure GUI 2. get congiguration 3. close configure GUI 4. open up main GUI now when I am testing in netbeans, this works perfectly however, as soon as I compile and try to run the jar file outside of netbeans the …

Member Avatar for alastair1008
0
217

The End.