32,199 Topics

Member Avatar for
Member Avatar for bruceaj

I'm trying to pass "this" as an argument of a constructor. Is there any way can determine what the type of Object "this" is? Thanks....

Member Avatar for bruceaj
0
65
Member Avatar for wolfy101

[CODE]import java.util.*; class multiplicationquiz { public static void main(String[] args) { Scanner a = new Scanner(System.in); int b,right,totalscore; right = 1337; //boredom totalscore = 0; b = 0; do { double numb = Math.round((Math.pow(10, 2) * Math.random())); double numb1 = Math.round((Math.pow(10, 2) * Math.random())); double valueFirst; double valueSecond; valueFirst = …

Member Avatar for rigidboss
0
95
Member Avatar for ineedhelp09

Hey everyone, I'm new at this.. so please bear with me. Anyway, I'm really confused. I'm supposed to convert the first character of the String firstName to upper case. Problem is... I have no idea how to :-/ I've done so much research and reading and still nothing. Please help …

Member Avatar for webmstr
0
187
Member Avatar for ceatkin2

Here's my problem. I'm reading in a string of numbers from the user using the scanner class in the main method. I assign that to a variable "s". I pass "s" to a method that converts the String (let's say its a string of 10 numbers) and trying to convert …

Member Avatar for oldSoftDev
-1
110
Member Avatar for gibson.nathan

ive got most of this figured out. the problem is then when i run, instead of my methods iterating through my array list, they simply reuse the same data set over and over, giving the same results. if anyone can help, it is appreciated. [CODE] /** * Write a description …

Member Avatar for gunjannigam
0
126
Member Avatar for faeze.m

please help me to write a program polynomial codes in java(multiply.add &.....between polynomial)????ok? every one can write this program please help me... thanks alot:icon_smile:

Member Avatar for rcook
0
85
Member Avatar for frankycool

I have an arraylist As such :- products.add( new CarsSubProduct( "FordMustang",1,12,10000 ) ); products.add( new CarsSubProduct( "JEEP",2,10,10000 ) ); I am trying to Edit just the value 12 without altering the value of the other objects but no success.When i use the set method it automatically modifies all the four …

Member Avatar for ~s.o.s~
0
847
Member Avatar for Rahyalain

This my problem>>>>if any one can solve it>>> Write a java program that calculates and prints out bills of the city water company. The water rates vary, depending on whether the bill is for home use, commercial use, or industrial use. A code of 1 means home use, a code …

Member Avatar for VernonDozier
0
2K
Member Avatar for tknopriest

OK... so I am pretty new to Java and need some help. I'll try to explain as best I can... I am trying to create a frame that will be a "menu frame" and then based on which option the user picks (JButton) it will then run the version of …

Member Avatar for tknopriest
0
75
Member Avatar for spiderpratik

How do I run an applet in the BlueJ terminal window? Please provide a code for the solution or an alternate method to do this as soon as possible. [code=Java] package applets; import java.awt.event.*; import java.awt.Graphics; import java.awt.Font; import java.applet.Applet; public class NervousText extends Applet implements Runnable, MouseListener { String …

Member Avatar for spiderpratik
0
101
Member Avatar for Bheeman89

Hello Guys. I need a help here. I am doing a system using Java with GUI. SO im curious how to add a value that i have extracted from a JTextField and display it as a List in the Jlist. Here is my coding [CODE] //function for collecting data from …

Member Avatar for javaAddict
0
522
Member Avatar for udayangaS

hey guys, i have a problem when am deploying a spring application i tomcat... i have got exception like this. [CODE]Nov 15, 2009 3:43:53 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'dispatcher' Nov 15, 2009 3:43:53 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable java.lang.NoSuchFieldError: ruleMemo at org.springframework.expression.spel.generated.SpringExpressionsParser.<init>(SpringExpressionsParser.java:94) at org.springframework.expression.spel.antlr.SpringExpressionsParserExtender.<init>(SpringExpressionsParserExtender.java:37) at org.springframework.expression.spel.antlr.SpelAntlrExpressionParser.<init>(SpelAntlrExpressionParser.java:51) at …

0
70
Member Avatar for Ryujin89

I have created the output for a program that allows a user to input their employee name and number and then their hourly wage and their total number of regular hours and overtime hours. This is my first time working with this type of program in java and I'm having …

Member Avatar for Ryujin89
0
204
Member Avatar for pwk064

I need to change the font size after I click. How can I do that - Thanks! here is the code [code=java]import java.applet.*; import java.awt.*; import java .awt.event.*; import javax.swing.*; import java.util.*; public class JChangeFont extends JApplet implements ActionListener { JLabel question = new JLabel("Who's number one?"); JButton click = …

Member Avatar for peter_budo
0
90
Member Avatar for JavaStudent23

[B]Hi everyone,[/B] I’m working on a public transport card system which records the no. of stops of the journey and then calculates the costs. I’m a bit lost with this program and I hope you can help me... Features; the fare for up to 3 stops is charged £4, after …

Member Avatar for javaAddict
0
122
Member Avatar for triplea_2005

The question ask: Write a program that asks the user to enter one of the following state abbreviations: NC, SC, GA, FL, or AL. The program should then display the name of the state that corresponds with the abbreviation entered (North Carolina, South Carolina, Georgia, Florida, or Alabama). This is …

Member Avatar for thines01
0
101
Member Avatar for Devoted Hosting

Hello there, I am curious as to whether there's any 'easy' way of creating 3D models (e.g. animals, Humans etc) via a Java applet? I know in a full-blown application one could use Java 3D (with the Java 3D libraries being installed with the application), but is there an 'easy' …

Member Avatar for Devoted Hosting
0
108
Member Avatar for TigerGirl

Hi. I am trying to write a mergeSort method, but I keep getting the wrong sorted array. [CODE]public static void mergeSort(int[] num, int left, int leftEnd, int right, int rightEnd) { int [] temp = new int[num.length]; int position = left; int number = (rightEnd + leftEnd) - 1; while( …

0
75
Member Avatar for obautista

I need help converting this code that is using Linear Probing to Quadratic Probing. I am not sue how to accomplish that. Can someone help me? Thanks so much... import java.util.*; // A HashMap class which uses linear probing public class HashMap383<K, V> { // array-based; this is the array's …

0
65
Member Avatar for kiranpvsr

Hi, I have built a web browser using JEditorPane . But instead of using setPage method, I have used setText method The code sample looks like this: displayEditorPane.setPage(pageUrl); // Get URL of new page being displayed. URL newUrl = displayEditorPane.getPage(); When setPage is used, correct URL value is stored in …

0
62
Member Avatar for frankycool

HI i am using this syntax to store arraylist to inventory.dat file.When i store, it give a scattered output on the .dat file like this..... ¬í sr Carsguimainexecution.SaleinfoÕE£ñWfö L productsalest Ljava/util/ArrayList;xpsr java.util.ArrayListxÒ™Ça I sizexp w sr Carsguimainexecution.SalesubZ㾝ÓÅ xr Carsguimainexecution.SaleProductøié>‘2q I CarnumberD pricesoldI productNumberD stockD unitsoldL Carbuyert Ljava/lang/String;L Carnameq ~ xp …

Member Avatar for javaAddict
0
216
Member Avatar for kjiu

Hj, Why does't appear at editor ? [CODE] public void date() { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); java.util.Date date = new java.util.Date(); String datetime = dateFormat.format(date); this.editor.insertPlainText(datetime); }[/CODE]

Member Avatar for javaAddict
0
67
Member Avatar for ninjaelves

Hi im trying to use an equals method to check if two bargraphs are equal, but when I run the method, it always says that they are not equal. Could you please tell me how to fix this? Thanks My code for the method [CODE] // equals method public boolean …

Member Avatar for javaAddict
0
130
Member Avatar for ramjeev

Can u suggest any better link for datastructure that explains with diagrams?It would be good,if any basic level explanation with algorithms.

Member Avatar for ramjeev
0
75
Member Avatar for frankycool

I have an arraylist As such :- products.add( new CarsSubProduct( "FordMustang",1,1000,10000 ) ); FordMustang is Car name 1 is Car number 1000 is total number of cars in stock 10000 is price per car I will like to Store it to access database or excel.Please how can these be done.

0
73
Member Avatar for kettavan

Hi guys, I need some help regarding JComboBox. I want to link the JComboBox with JTextField and this is the code that i did. It contains error and I need some guidelines for it.Thx [code=Java]private void typeof_patronJComboBoxitemStateChanged(ItemEvent event) { // clear JTextFields clearComponents(); // determine whether checkbox selected if (event.getStateChange()== …

Member Avatar for kettavan
0
86
Member Avatar for starlight09

Hi everyone, My goal is to generate lottery numbers that have 6 unique numbers in the range of 1-49 ex. if the user inputs 2 as the number of tickets they want, the program should print out 1 2 3 4 5 6 10 9 8 7 12 11 ---2 …

Member Avatar for starlight09
0
614
Member Avatar for javanub123

hi, i have a lab monday which requires me to generate random sized squares random poinst. im not to familiar with the random class and the syntax and all that but im guessin i need to use a for loop. if someone can just point me in the right direction …

Member Avatar for javanub123
0
1K
Member Avatar for javanub123

im trying to make my program draw lines from the top right corner of the JFrame which is 400 x 400, to the bottom of it making what looks like a curve but really is just lines. i think i know the basic idea of how to do this which …

Member Avatar for javanub123
0
1K
Member Avatar for jlperry_2009

I am having a problem understanding how to sort a set. I have read the Big Java book, and I still don't understand how to do it. Could someone please assist. [code=JAVA] /* * To change this template, choose Tools | Templates * and open the template in the editor. …

0
61

The End.