36,051 Topics

Member Avatar for
Member Avatar for musikluver4

I just wanna be able to input 10 integer numbers, display the numbers, then be able to modify a specific number I have already entered, then display the new updated numbers again. [code] //Date: 4/6/2010 import java.io.*; public class EnterNumbers { public static void main(String[] args) throws IOException { BufferedReader …

Member Avatar for musikluver4
0
217
Member Avatar for bravo659

[quote] I am working on a homework asisgnment from school and need some help. I am stuck on coding to set a private field to my Box class with three constructors.. It's kind of confusing when dealing with more than one constructor. The following is the code for the box …

Member Avatar for vchandra
0
176
Member Avatar for why1991

I am trying to make a row of decreasing squares with a recursive method, but none of the squares comes up besides the first one. Any ideas where my code is going wrong? [CODE] import java.awt.*; import java.awt.event.*; import java.util.Random; public class Lab19ast { public static void main(String args[]) { …

0
84
Member Avatar for johndoe444

What is the meaning of compiling a regular expression? Not only in java but also in other languages like python has compiled representation of a regular expression. Actually it always bothers me what happens when a regular expression is compiled? All I know is it makes further matching of patterns …

Member Avatar for BestJewSinceJC
0
85
Member Avatar for bigbags911

import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TicTacToeV1 implements ActionListener { /*Instance Variables*/ private JFrame window = new JFrame("Tic-Tac-Toe"); private JButton button1 = new JButton(""); private JButton button2 = new JButton(""); private JButton button3 = new JButton(""); private JButton button4 = new JButton(""); private JButton button5 = new JButton(""); …

Member Avatar for BestJewSinceJC
0
131
Member Avatar for idlackage

Dumb question, but I've searched everywhere and found nothing specific: is it possible for HSB values to translate directly into a colour (eg. a hue of zero equals red) instead of passing them through an RBG conversion? Also, dumber: I'm not understanding the arrrays people are using, for example [URL="http://www.squarebox.co.uk/users/rolf/download/ColourWheel/ColourWheelApplet.java"]here[/URL] …

Member Avatar for idlackage
0
97
Member Avatar for isuruj

I tried to execute following target. [code=xml]<target name="A"> <svn> <checkout url="${svn_url}" destPath="ab"/> </svn> </target>[/code] and I got the error "failed to create task or type svn Cause: The name is undefined." I have TortoiseSVN, ant home is ok, got the antsvn lib and put them into ant_home\lib So I don't …

Member Avatar for jonataschagas
0
52
Member Avatar for falsedimitrii

I want to enable/disable a table cell based on the contents of another cell. e.g. if the reference cell value is "true", then enable the cell, otherwise disable the cell. I have set up isCellEditable() to do this and it works if the reference cell already has a value when …

Member Avatar for falsedimitrii
0
2K
Member Avatar for triplea_2005

Write a Java Class file for the class Account that represents a bank account. Usually, a bank account has a unique account number that is used to identify it. Your class should generate the account number automatically whenever a new account is created. The class should also store the account …

Member Avatar for triplea_2005
0
206
Member Avatar for artanbori

Hi struggling with java - we have a class Structures and Algorithims in which we are supposed to pick up java in 5 weeks Have been pouring over material and searching sites but trouble is when I start to write ends up nothing seems to work unless we copy and …

Member Avatar for artanbori
0
312
Member Avatar for shantuli

hi, can anyone help me to solve the following java problem write a java program for holding a stack of up to 10 characters. pls help me. thanks you shantuli

Member Avatar for usurph
0
103
Member Avatar for picabodaddy

Trying to learn Java on my own with the book "Starting out with java" The question is this Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes: circles rectangles cylinders (it gives the formulas for the are of them) Because the …

Member Avatar for vchandra
0
3K
Member Avatar for deraj8

I am trying to understand how draw graphics to the JPanel class but i have only been able to display one object at a time(unless i draw muiltiple shapes in my extended JPanel class but i dont want that!) [CODE]import java.awt.*; import javax.swing.*; /* Create a new graphics component that …

Member Avatar for mart@efun.ee
0
3K
Member Avatar for Riddlekid

I need to use Scanner and StringTokenizer to find a word then print that line in text area when found it. This is the Search Button's coding : [CODE]private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) { try { Scanner scan = new Scanner(file); String search = txtSearch.getText(); while (scan.hasNextLine()) { line = scan.nextLine(); …

Member Avatar for Riddlekid
0
473
Member Avatar for sohai

Now, I've just done a calculation program. What I need now is to build a [B]Semester[/B] class that will contain information about the list of subjects taken in a semester, the corresponding grades as well as the grade average for that semester. How should i build the class to store …

0
68
Member Avatar for Merosansar

The code for sleeping barber problem. When the status of the barber is set to busy then the customer cannot have a hair cut and is added to the waiting queue. when the customer is set to free then the customer have a hair cut. Here the problem is that …

0
70
Member Avatar for herat_000

I want to shift the value in columns after comparision. I am having problem with the getString command. It results in an error ….my code is like this [code]for(p=1;p<20;p++) { Class.forName("com.mysql.jdbc.Driver"); Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/srch","root",""); Statement stmt2=con.createStatement(); ResultSet rs2=stmt2.executeQuery("select * from "+tbl+"c"+startc+" where keyword='"+sk[i]+"'"); cnt=0; if(rs1.findColumn("count"+p) > 0) { System.out.println("count"+p); cnt=rs2.getInt("count"+p); if(cnt …

Member Avatar for masijade
-1
125
Member Avatar for syamala devi

hi all community people iam an IT student .i have a 2 months free time.i want to do a miny project in java,i have knowledge in java(j2se),swings,jscript. if any one have mini java project ideas then send to me.iam waiting for good suggestions.pls reply me as soon as possible.

Member Avatar for peter_budo
0
450
Member Avatar for kolibrizas

I would like to make a dwg->pdf one, and I also prefer java programming language, but I do not know where shall I start. Are there any good tutorials for any conversions, etc? Thanks!

Member Avatar for stultuske
0
78
Member Avatar for Privoxy

Hi All I have been stuck on this for a number of hours now, really cant workout how I should go about making this work, I am not looking for the correct code, More looking for what I should be looking up and what I have done wrong. What the …

Member Avatar for BestJewSinceJC
0
211
Member Avatar for KSUliz

Hi Everyone. I am taking a class on java, and have made it to chapter 7 without many problems. I am having really bad problems with this, getting an illegal start of expression where it says public void sort....I have tried so many things, I probably even have things out …

Member Avatar for stultuske
0
643
Member Avatar for kesh1000

hi can anyone give me a suggestion as to how i could replace data in dat file. the problem is that if i put the data into a string buffer and call replace it will not change the data in the file but i need that to hapen and the …

Member Avatar for stultuske
0
127
Member Avatar for Colin454

Hi all I am enrolled in abeginners class and am having problems with methods. I keep getting a .class expected and do not know how to fix this. It is at this line that the message appears `total = Circle.area(int radius);`. import javax.swing.JOptionPane; public class Circle { public static void …

Member Avatar for Colin454
0
119
Member Avatar for drbrown3

Ok, using Jgrasp I was given a problem that asked me to design a GUI program to find the weighted average of four test scores. The four test scores and their respective weights are give in the following format....testscore1 weight1 This is what I have so far, the code will …

Member Avatar for masijade
0
462
Member Avatar for zerioni

Ok, so i am quite new to JSP. Working on a big database project, and I'm left scratching my head here. The ugly code below calls the chemical name and chemical id properly, and links the chemical name to a page where the chemical with that id will be viewed, …

Member Avatar for peter_budo
0
84
Member Avatar for c++student01

This is a school project. I need to read jokes from multiple files and show them in separate threads. It complies but I keep getting IndexOutOfBoundsExceptions. Any tips or help you can give would be greatly appreciated. [code] import javax.swing.*; import java.awt.*; import java.io.File; import java.io.*; import java.io.FileNotFoundException; import java.awt.event.*; …

Member Avatar for vchandra
0
143
Member Avatar for nwalser

so my assignment is: For this assignment, your job is to create a program that reads in multiple lines of text, and then produces the translation of that text into the English language variant known as "pig latin". Pig latin works this way: if a word begins with a vowel …

Member Avatar for kvass
0
227
Member Avatar for marcel25

[code]import java.awt.*; import java.awt.event.*; import javax.swing.*; public class tictac2b1 implements ActionListener { /*Instance Variables*/ private int[][] winCombinations = new int[][] { {0, 1, 2}, {3, 4, 5}, {6, 7, 8}, //horizontal wins {0, 3, 6}, {1, 4, 7}, {2, 5, 8}, //virticle wins {0, 4, 8}, {2, 4, 6} //diagonal …

Member Avatar for BestJewSinceJC
0
93
Member Avatar for Unitaren

Hello, This is my first post to the community. I have never really been one to ask of much help but I am stumped. I was asked to asked to write a word count program that received input from a scanner object. The input could consist of one or more …

Member Avatar for Unitaren
0
5K
Member Avatar for johndoe444

Hi, I have written this piece of code: [CODE] public class testAssert { 2 public static void main(String[] args) { 3 int x = 5; 4 int y = 7; 5 assert x != y; 6 } 7 } [/CODE] I am not sure how to make use of this …

Member Avatar for johndoe444
0
198
Member Avatar for Millsington

To me, what I want to do is extremely simple. I will have multiple users, each will login to a character with info stored in a database. Each user enters commands into a text field which will post the info to a page that will return the result of the …

0
53
Member Avatar for spacecowboy123

Hi All, I am using ImageIcon to display an image, however, the image does not appear. See the code i am using below. Can you see what the problem is? The receivedImage will be taken out of an object it is stored in, and then i want to display it …

Member Avatar for Abdelr7man
0
199
Member Avatar for Swingjohn

I have done a mortgage calculator program. it builds and run but I think tje GUI must be wrong because I cannot see it. I am very new to this and I am so lost. I do not know if this is the right forum. [code]import javax.swing.*; import java.awt.*; import …

Member Avatar for Swingjohn
0
226
Member Avatar for onsir

how to change database at runtime, i use hibernate and spring. i have make like this hibernate.cfg.xml [code] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <mapping class="com.model.Person" /> <mapping class="com.model.Group" /> </session-factory> </hibernate-configuration> [/code] spring.ctx.xml [code] <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" …

Member Avatar for keerthi166
0
1K
Member Avatar for jemz

hello can you help me how to trap the textfield length..example if i will iput in my textfield 00001 then it will only accepts 4 digits can you help me how to make this trappings...hoping for your positive responds....

Member Avatar for BestJewSinceJC
0
56
Member Avatar for lakshma.sugunan

When some datas are inserted in to a DB table from a jsp page, how do i get the primary key in my table autogenerated?? finiding out the highest value for the primary key in the table? Pls help me wid the coding in JAVA or HTML.. I use SQL*PLus.

Member Avatar for emsm
0
278
Member Avatar for dsmush

Hi, I'm creating a Java Swing application that lets the user enter the usual details one would expect in an address book then click the save button. The current JPanel will then be hidden while another JPanel is shown. This second panel is used for viewing all the contacts added …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for ceyesuma

Hello; I am trying to build a JDesktopApp The structure of a Session in a web app: a user logs in and a session specific to the user is saved.(basically). My question is dealing with a Desktop app. If a user logs in can the same concept be used? I …

Member Avatar for ceyesuma
0
125
Member Avatar for sabah_786

Hey all. Ok i've written the code below with no syntax errors. However, im struggling. 1) For Button 1 - Check Balance, I want to firstly bar out the pin number so it doesn't show. How do I do this? 2) For button 1 - I have added show input …

Member Avatar for sabah_786
0
278
Member Avatar for lrolsto1

For a CS project, I need to have my program "gracefully terminate" in case of certain user input errors. What is the best syntax to do this?

Member Avatar for aspire1
0
78
Member Avatar for lrolsto1

Assignment: Create a program to practice reading in from a file, search for a particular word when the user inputs a word to search for and a file via command line args. Print out the entire line each time it is found. Progress: It compiles, and runs.... kinda. Problem: I …

Member Avatar for BhagatS
0
91
Member Avatar for albertkao

How to store variables in the jsp page scope with the spring 2.5.x framework? This has compile errors. [CODE]import javax.servlet.jsp.PageContext; @Override public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pageContext; Object o = pageContext.getAttribute("com.mycompany.pageId");[/CODE] Description Resource Path Location Type The local variable pageContext may not have been initialized …

Member Avatar for albertkao
0
122
Member Avatar for pavan146

Hi , actually we are in need of free web space which supports services for JSP n servlets...Can anybody pls post me the link of that which provide above facilities...Thank you for readin ma thread

Member Avatar for peter_budo
0
79
Member Avatar for rumpleteaser33

Hi, I'm trying my first program using servlets and JSP and would appreciate any help or advice about a problem I'm having. In my servlet I'm connecting to the database and displaying all the records in there. I'm then trying to add data to a JavaBean so that I can …

Member Avatar for peter_budo
0
169
Member Avatar for shroomiin

hey everyone. I am supposed to make a program that finds the smallest number out of a set of numbers. the amount of numbers input is up to the user. i have to print the smallest number, and what input it was (ex, 1st number 2nd number 3rd number...) i …

Member Avatar for dlucke17
0
116
Member Avatar for hsncvs

Hi guys, i need some help on my java homework. i need a text box which will have a piece of text. then i must show how many times every word has written in the text. in my way of thinking i should add every word to an array and …

Member Avatar for stultuske
0
103
Member Avatar for shahab.burki

Hi, I am stuck in building 2D Array from StringBuffer. I am reading data from a file and store it in a StringBuffer object by appending "\n" at the end. My read method is in the following. [CODE]public void tmFileReader() throws IOException { Work wrk=new Work(); StringBuffer buffer=new StringBuffer(); FileInputStream …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for shahab.burki

Hi, I am developing a TM simulation program. But got stuck in execution as it goes wrong. The Code is the follwing. 1. Java Code [CODE]import java.io.IOException; public class TMSimulation{ public static void main(String args[]) throws IOException{ InputReader reader=new InputReader(); reader.tmFileNamereader(); reader.tmFileReader(); //fileReader.display(anArray) } }[/CODE] [CODE]import java.io.*; public class InputReader{ …

Member Avatar for BestJewSinceJC
0
143
Member Avatar for aym312

hello! I have run into a brick wall trying to write a traffic light program. The program must display a traffic light (so far I have tried painting it on a Graphics) and use radio buttons (red, yellow, green) to change the color of the light. So far, I've got …

Member Avatar for aym312
0
1K
Member Avatar for kesh1000

hi please can anyone help me with this code. the prob lies in the add function for some reason it only executes 2 lines of the code and as soon as i enter the data the program finishes [CODE] import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.io.*; class customers{ private …

Member Avatar for kesh1000
0
132

The End.