36,051 Topics

Member Avatar for
Member Avatar for javaprog200

Hello, I am working with the AudioClip class. It has methods for playing, stopping and looping an audio file (.wav/.au). Is there a way I can check when an audio file has completed playing? The stop() method is void. Is there any other class I can use? Thank you!

Member Avatar for javaprog200
0
88
Member Avatar for raul8

Hi, please look the following code and help me solve the question I mentioned in Comment([B]Line number 85[/B]) below: [CODE]import java.io.InputStream; import java.util.HashMap; import java.util.Map; import org.jacoco.core.analysis.Analyzer; import org.jacoco.core.analysis.CoverageBuilder; import org.jacoco.core.analysis.IClassCoverage; import org.jacoco.core.analysis.ICounter; import org.jacoco.core.data.ExecutionDataStore; import org.jacoco.core.instr.Instrumenter; import org.jacoco.core.runtime.IRuntime; import org.jacoco.core.runtime.LoggerRuntime; public class TestClass { public static class TrgClass { …

Member Avatar for NormR1
0
211
Member Avatar for javaprog200

Hello, The following is a bouncing ball applet. When I do double buffering (variables, g1 and image), I still see the flickering . I would be grateful for any help. [CODE]import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.lang.Thread; public class Ball_Bounce extends JApplet implements Runnable { private Thread blueBall, redBall; …

Member Avatar for javaprog200
0
203
Member Avatar for bhallarahul

javax.naming.NameNotFoundException: Name evn is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContext.lookup(NamingContext.java:781) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152) at javax.naming.InitialContext.lookup(Unknown Source) at listener.MyContextListener.contextInitialized(Unknown Source) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at …

Member Avatar for bhallarahul
0
343
Member Avatar for ujjwale

How to we know that there is the error of javac. "I studied that javac is not internal or external command". This is the error so how do we know that this error has evolved?

Member Avatar for javalover
0
138
Member Avatar for libran

The code on which I am working, suppose to read the contents of a file "applicants.txt" linewise and store it in a string array. Each element of array should hold one line and so on. I also want to automate the code so that when end of file is reached …

Member Avatar for stultuske
0
1K
Member Avatar for shootingrubber

Code 1: [CODE]public class Ticket { private int nextSerialNumber = 100; private int serialNumber ; public Ticket () { serialNumber = nextSerialNumber; nextSerialNumber = nextSerialNumber + 1; } public int getSerialNumber () { return serialNumber ; } public static void main( String [ ] args ) { Ticket t1, t2, …

Member Avatar for stultuske
0
150
Member Avatar for ravi_91

friends,, here i have some problem. i did a program for uploading file into "D" drive using "html" and "jsp" but my main problem is when 3 users uploaded their files into "D" drive then how can i differentiate those 3 files means while retrieving files users should get the …

0
64
Member Avatar for TrickyT

I need to use a GUI for a program (with a main, superclass and subclass) that I've already written (am quite proud of actually. LOL). I'm super new at this so I want to keep it simple and just display the output of my program (an array of inventory objects) …

Member Avatar for stultuske
0
158
Member Avatar for jadeplaza

Pls. help me to revised my code , i base my java calculator code on youtube tutorial but it was denied because almost half of our class base their code on the youtube tutorial and i need to pass the code by monday.or if possible , can you give me …

Member Avatar for stultuske
0
215
Member Avatar for raym.mart

can anyone help me out with the errors .. please [CODE]import java.io.*; import java.util.*; class Directory implements Comparable { int id; String name; String address; int phoneNo; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } …

Member Avatar for raym.mart
-1
251
Member Avatar for TIM_M_91

Hi guys well I have two class's 1 class for my methods and another class for my GUI. In my method class I have my update statements for my database and in my GUI class I have obviously my gui and all my buttons that will produce a result when …

Member Avatar for stephen84s
0
186
Member Avatar for vgpans

Hi, I've used g.drawRect(----) and some other stuffs and happily accepted o/p but really want to enhance myself in knowing how to code it if I want to draw the same figure in reverse direction.

Member Avatar for stephen84s
0
87
Member Avatar for xeffer
Member Avatar for raym.mart

NEED HELP .. where can I do start if I want to create a simple application that do have a record file and a java file ? any suggestions or recommendations

Member Avatar for raym.mart
0
227
Member Avatar for asif49

I need some help with a project that I'm working on. I have to make a program which can store hierarchical data to represent an employee referral system (and who has referred who/who was referred by whom). This needs to be able to traverse both ways, I.E. Bill has referred …

Member Avatar for asif49
0
106
Member Avatar for LdaXy

i was writing some code for a small project i'm working on and form somke reason, it never displays the main function. it just makes the user input 7 times before crashing. any ideas? i can't seem to locate my error. [CODE]package rtnasm; /* * RTNASM - n64 assembler * …

Member Avatar for ejosiah
0
290
Member Avatar for nilay84

Hi Everyone, Does anyone know how to add the user input into an array in java. for instance I have a table of 3 columns and 4 rows the 3 column is designed to allow the user to input 1 or 0. so whenever they typed in anything I want …

Member Avatar for Syrne
0
129
Member Avatar for wonderlandslost

So I'm writing a program that has a main class ArrayDrawer and two classes; square and triangle. Currently, this is what I have; [CODE] public abstract class ArrayDrawer { //Global Data /** * Create array with object scope to store squares in */ protected Square[] squares = new Square[10]; /** …

Member Avatar for NormR1
0
255
Member Avatar for lena1990
Member Avatar for 03hasnam

want to append information onto a file based on user selection of minutes (1 min, 15, 30, 45min etc) through radio buttons. for each radio button there are case in switch statement. I am finding it difficult to update the file on a regular interval, continously, does anyone know how …

Member Avatar for NormR1
0
92
Member Avatar for sagar2dumbre

AJAX has retrieved value(using some DB operation)and inserted in text box.while retrieving that values on onClick event of button System.out.println shows null value.i want to retrieve value of "emp" input tag jsp file code:- [CODE] function checksubmit1() { document.w1allot.prepare.value=1; document.w1allot.submit(); } function showState(area_value) { if(document.getElementById("ddlFlat").value!="-1" || document.getElementById("emp").value!="") { xmlHttp=GetXmlHttpObject() xmlHttp1=GetXmlHttpObject1() …

0
190
Member Avatar for nidheeshkumar.r

hey, im doing a project on processing images and i'd like to extract the features of an image stored in databse.How can i do that? anyone help..,please..

Member Avatar for NormR1
0
1K
Member Avatar for MohEzzat

I ask for help if any one know how to filter words from text file. if the file contain(book,books,booking,..)I want the filter to retrieve only book and booking also if it contain(get and got)choose only the verb "get". any help Thanks.

Member Avatar for stultuske
0
192
Member Avatar for jackbauer24

Here is my problem:- On my desktop, there is a folder called "Test." In Test, there is a folder called "toUse." In "toUse," there is a java source file called "Test" and three folders, namely "Print," "SwingFrame" and "TextFileWriter." The source file for "Test.":- [CODE]package Test.toUse; import Test.toUse.Print.Printer; public class …

Member Avatar for NormR1
0
110
Member Avatar for javitis

Hello to everyone! I am working on a simple application like a search engine.It searches in an index(a txt file with filenames). If a match is found, it displays the complete path where the keyword is contained and opens the path. It's a movie catalog and searches for the movie …

Member Avatar for stultuske
1
304
Member Avatar for XTMercenary

I'm creating a tv schedule for a hotel and need to be able to fill the schedule with particular programs that take up various amounts of time each slot is 30 mins so a film with a 1hr 30 min run time would take up 3 slots but i'm not …

Member Avatar for XTMercenary
0
184
Member Avatar for rereni

Hello Programmers, is it possible to create new 1D array from 2D array? for example from this array String[][] ArrVal= { {"rec", "02"}, {"proc", "03"}, {"hscode", "10"}, {"sitc", "21"}}; take first column of ArrVal[i][0] and make this as new array with ArrVal[i][1] as value of new array, for example : …

Member Avatar for JamesCherrill
0
173
Member Avatar for Hypnos_16

I have an assignment question that asks us, given a test phrase, [CODE]// the first comment public class Test { // another comment public static void main( String[] args ) { // the main method String slashes = "//"; // ignore // in quotes System.out.println( slashes + " hi " …

Member Avatar for stultuske
0
208
Member Avatar for rammohanrao

Hi, i am working on liferay , i want to develop a sms application in liferay, if you have any code can you send me to <EMAIL SNIPPED> Thanks.

Member Avatar for stultuske
0
126
Member Avatar for Niittii

Here is the Login.jsp: [ICODE]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Login</title> <script type="text/javascript"> </script> </head> <body bgcolor="#999966"> <p>&nbsp;</p> <form method="get" action="http://localhost:8080/WebApplication1/Login"> <% if (request.getAttribute("error")!=null) { %> Login failed. Please try again <BR><HR> <% } %> <p> &nbsp;&nbsp;&nbsp;&nbsp;Username: <input type="text" name="uname" size="20"></p> <p> …

Member Avatar for vtm
0
485
Member Avatar for wonderlandslost

So my instructor assigned us to create a program that calculates the area and stores that, along with coordinates, in an array. This has to be done for both triangles and squares. He is having us use separate classes for the project; the main Drawer class, parent class, square class, …

Member Avatar for wonderlandslost
0
307
Member Avatar for whateverme

Hey, I'm trying to work to display a number of jtextfield according to one of the given values in a combobox. So, I will have a drop down menu with let's say 1 to 4. If the user selects 3, 3 textfields will be displayed. I've created the jcombobox with …

Member Avatar for whateverme
1
143
Member Avatar for coolbeanbob

Just wondering if it is worth taking the time to learn the GUI packages, or do most developers use GUI designers? I am guessing the GUI designers are more often used by hobbyist, while the professional developers write the code?

Member Avatar for designuts
0
231
Member Avatar for therockon7throw

The puzzle The original puzzle is in Java [url]http://wouter.coekaerts.be/2012/puzzle-clowns[/url], so I tried to write it in C++ and post it here for your, so that you solve it and having some thing to think:-) There almost aren’t any rules; any cheating inside your code is allowed; it is the whole …

Member Avatar for therockon7throw
0
195
Member Avatar for TIM_M_91

Hi guys well I have successfully got my update query to work correctly. Now I have two tables in my database. What I want to do is when I click my play button not only does it update my column's in my first table but all updates my colunms in …

Member Avatar for TIM_M_91
0
187
Member Avatar for BleepyE

Hi guys, I need some help. Im trying to create a comment system in an applet. When a user enters a new comment all previous comments are shown below. The comments are taken from two text fields. At the moment im just storing the latest 2 comments in variables, I …

Member Avatar for DavidKroukamp
0
133
Member Avatar for baseballer

I'm just trying to teach myself how to use java.util.zip, but I'm struggling with one part I think. The code below is what I have so far, I'm just not sure how to actually get it to read in a zip file? Any help would be much appreciated. [CODE] import …

Member Avatar for DavidKroukamp
0
129
Member Avatar for glebovg

Create a class called CardDeck with a main method contents exactly as shown here: [CODE]{ String[] deck=new String[52]; createDeck(deck); for(int i=0; i<52; i++) System.out.println(deck[i]); }[/CODE] You should create a method called createDeck which populates the array you created in the main method. You must use four loops, each creates the …

Member Avatar for glebovg
0
261
Member Avatar for ForceStr

Hello, I'm here again with another issue. :) I have written almost every part of my program what I'm gonna need (I did it as separate projects). But now I need to create "main program". And I don't know exactly what is the best way to add these "parts" of …

Member Avatar for ForceStr
0
148
Member Avatar for dsmith12

Ok in this code the user has to type in their first and last name together otherwise it is invalid. I know I have to use some sort of java.lang.character but i do not know how to write it up. I know that it needs to be a part of …

Member Avatar for StephNicolaou
0
195
Member Avatar for AbdullahJava

How can i make the words in alphabetical order if there are not the same ??? [CODE]import java.util.Scanner; public class Alphabetize{ public static void main (String [] args) { Scanner input = new Scanner (System.in); System.out.println("Enter three words"); String Word1, Word2, Word3; Word1 = input.next(); Word2 = input.next(); Word3 = …

Member Avatar for stultuske
0
172
Member Avatar for kris222

this should be the output: 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 i ve done so far: class za { public static void main(String[]args) { String x="abcdefghijklmnopqrstuvwxyz"; int ctr; …

Member Avatar for stultuske
0
98
Member Avatar for sahmeme

only the first item in the combobox will be returened even if i selected another item. HELP! [CODE] try{ //combobox of the products rs = stmt.executeQuery(query2); rs.last(); int i = rs.getRow(); String [] v = new String [i]; rs.beforeFirst(); i = 0; while(rs.next()) { v[i] = rs.getString(2); i++; //break; } …

Member Avatar for mKorbel
0
159
Member Avatar for rockstar03

I have been searching high and low to find something remotely close to what I am trying to accomplish and have failed, miserably. I have read Oracle and tutorials, but have a hard time comprehending everything related to java. It is all so confusing. I would just be grateful for …

Member Avatar for rockstar03
0
191
Member Avatar for johnarzoneecho

Hey, My program is to add images to database using class GUI in java. Ang i can not get into a code that can insert into database I'am using this codes: import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.sql.*; import java.util.*; import javax.swing.event.TableModelEvent; import javax.swing.table.DefaultTableModel; import javax.swing.event.TableModelListener; public …

Member Avatar for johnarzoneecho
0
220
Member Avatar for bela_code

need a complete code for a car class with the following attributes; make model colour registration no of seats wheel type (alloy or hubbed) engine size (in cc)

Member Avatar for ztini
0
437
Member Avatar for scheppy

I am having a problem with setting JButtons so the are not opaque to i can see the image behind them. I also have a JTextfield and here it is working, I dont know what i am doing wrong, I'm creating a gui for the mainmenu of my game. here …

Member Avatar for scheppy
0
328
Member Avatar for kay19

Seem to be having trouble. The trouble i'm having is the calculateAverage, and a bit of the public static main void area. I'll explain: calculateAverage: What i'm suppose to do is read from the txt file. I tried doing the inFile.nextDouble part, but seem to be getting errors. i'm not …

Member Avatar for foxtich
0
3K
Member Avatar for tleverington1

Hello All, I'm in the process of making a GUI for a search engine, I have never coded a GUI before so just experimenting with user input in Textfields and also the use of ActionListeners and i'm having a slight problem. My code can pick up what the user has …

Member Avatar for tleverington1
0
194

The End.