Methods not found in class ! HELP !
Dear java People,
I am trying to draw, move, and erase balls in a ArrayList. I get an error message that says:
"BallDemo.java": Error #: 300 : method draw() not found in class java.lang.Object at line 126,
"BallDemo.java": Error #: 300 : method move() not found in class java.lang.Object at line 132
"BallDemo.java": Error #: 300 : method erase() not found in class java.lang.Object at line 138
below are the lines causing the errors and the method with the problem code
Thank you in advance
Stan
public void bounce()
int ground = 400; // position of the ground line
int numberOfBalls = 0;
myCanvas.setVisible(true);
ArrayList balls = new ArrayList();
// draw the ground
myCanvas.drawLine(50, ground, 550, ground);
//ex 5.50 (a)
System.out.println("Type in the number of balls you would like to see bouncing and hit enter");
numberOfBalls = input.readInt();
//(b)
for(int i = 0; i < numberOfBalls; i++)
//(c) (d)
Random rg = new Random(255);
BouncingBall newBall = new BouncingBall(i + 15, 0, 16, new Color(rg.nextInt(255),rg.nextInt(255),rg.nextInt(255)), ground, myCanvas);
//add the ball to the ArrayList object
balls.add(newBall);
for(int i = 0; i < numberOfBalls; i++)
balls.get(i).draw();
// make them bounce
boolean finished = false;
while(!finished) {
myCanvas.wait(50); // small delay
balls.get(i).move();
// stop once ball has travelled a certain distance on x axis
// if(ball.getXPosition() >= 550 && ball2.getXPosition() >= 550)
finished = true;
balls.get(i).erase();
}balls.get(i).draw();
balls.get(i).move();
balls.get(i).erase();
I actually caught this error myself !
I must be improving !
Cheers
Stan
Similar Messages
-
Method not found in class errors when compiling project
Hi,
I am getting the following errors when compiling my project:
Error(3,8): ReqLinesNotificationsVORowImpl not found
Error(25,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(31,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(37,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(43,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(49,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(55,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(61,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(67,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(67,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(79,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(85,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(91,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(97,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(103,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(109,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(115,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(121,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(127,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(133,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(139,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(145,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(151,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Number) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(157,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(163,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(169,25): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(175,9): method setAttributeInternal(java.lang.String, java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(181,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(187,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Date) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(193,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
Error(199,9): method setAttributeInternal(java.lang.String, oracle.jbo.domain.Date) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImplError(205,23): method getAttributeInternal(java.lang.String) not found in class oracle.apps.icx.por.wf.server.ReqLinesNotificationsVOExRowImpl
I have ReqLinesNotificationsVORowImpl and ReqLinesNotificationsVOImpl files in myprojects directory. Can anyone help please?
ThanksHi,
From the error it seems that the code is refering ReqLinesNotificationsVOExRowImpl file.
Please make sure that its class file is present in myclasses folder.
Since u have mentioned that ReqLinesNotificationsVORowImpl is already placed in myclasses folder. Hope this should resolve your issue.
Regards,
Raj Papdeja -
"method not found in class " error message !
Dear People,
I have an error message that says:
"Clerk.java": Error #: 300 : method doTransaction(stan_ch15p622.Transaction) not found in class stan_ch15p622.Bank at line 36, column 12
below is the Clerk class of the program.
doTransaction() is defined below the constructor and is called at the
bottom of the class.
Thank you in advance
Stan
package stan_From_Ivor_Horton_ch15p622;
public class Clerk implements Runnable
private Bank theBank; // the employer. who the clerk works for
private Transaction inTray; //holds a transaction
public Clerk(Bank theBank)
this.theBank = theBank;
inTray = null; // no transaction initially
//receive a transaction
public void doTransaction(Transaction transaction)
inTray = transaction;
//The working clerk...
public void run()
while(true) // no transaction waiting ?
while(inTray == null)
try
Thread.sleep(150); // then take a break
catch(InterruptedException e)
System.out.println(e);
theBank.doTransaction(inTray);
inTray = null;
//you can check whether a clerk is busy by calling the isBusy() member
// it returns true if the transaction is strill in progress
public boolean isBusy()
return inTray != null;
}Dear Hambone3,
Due to your help I was able to correct my error. I mispelled the
method in the Bank class. I wrote "toTransaction" instead of
"doTransaction".I have alwyas had a hard time interrpreting the
error messages literally because many times I don't see the
connection between the message and the error. Cold water over
the brain is sometimes what I need.
God bless you.
Stan -
Newbie:( error "Variable not found in class" help ppls
Hello, making a program for school having a problem with my code
because i am combining and modifying programs to suit my requirements,
the error is as follows
Error:(185) variable EXIT_ON_CLOSE not found in class javax.swing.JFrame
can anyone give me some idea's on how to fix this or where i have gone wrong have i left something vital out?
thanksHello, making a program for school having a problem
with my code
because i am combining and modifying programs to suit
my requirements, Script kiddie. I see. Bad approach.
the error is as follows
Error:(185) variable EXIT_ON_CLOSE not found in class
javax.swing.JFrame
can anyone give me some idea's on how to fix this or
where i have gone wrong have i left something vital
out?Weird error, since EXIT_ON_CLOSE is defines in JFrame. Are you using an IDE? Save, clean, rebuild. Make sure you imported the class, too. -
I am trying to send concurrent request (XML publisher report) through OAF controller.
But I get next error when compile it:
Error(46,20): method addLayout(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) not found in class oracle.apps.fnd.cp.request.ConcurrentRequest
Below the sample of code.
Please, help me to find a root of cause
package xxcust.oracle.apps.ap.oie.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.jdbc.OracleCallableStatement;
import java.util.Vector;
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OADBTransaction;
public class xxMyPrintCO extends OAControllerImpl
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OADBTransaction tx = am.getOADBTransaction();
java.sql.Connection pConncection = tx.getJdbcConnection();
ConcurrentRequest cr = new ConcurrentRequest(pConncection);
int xxRequestId = 0;
// concarent parameters
String xxp_type = null;
String applnName = "SQLAP";
String cpName = "XXKVP_KO1";
String LayName = "XXKVP_KO1";
String cpDesc = null;
try
cr.addLayout("PER",LayName,"ru","RU","PDF");
catch(Exception e)
{throw new OAException("addLayout -" + e.getMessage(), (byte)0);
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
}it was a bug described in doc [ID 1360914.1]
JBO-29000 java.lang.NoSuchMethodError When Calling oracle.apps.fnd.cp.request.ConcurrentRequest.addLayout [ID 1360914.1] -
JCAPS6- Migration "Method not found in the imported class"
Hi,
I work on Jcaps6 migration, I found that few of my migrated Jcd's throw compiler error as here
ERROR: Method getSegmentCount(java.sql.Connection, java.lang.String, java.lang.String) not found in class com.ack.mware.distribution.v2.filesplitter.InhouseFileAggregator at line 76
This happens to all the methods in the InhouseFileAggregator class which is our inhouse class comes with a jar file.
it seems like the methods in this class are not recognized by the main class which throws the abovesaid errors.
I have checked for the jar file which is found to be added and aslo I have checked with the eDesigner 5 which compiles without any error.
So I doubt this may be due to some compatible features with the JCAPS6 version.
Please someone help me to solve this issue. All the Jcd's are facing the same error due to this non recognizable inhouse API's.
Thanks in advance
Regards
PreethiHi Chris,
Thanks for the reply.
Here is what I do,
I did import the project into the JCAPS6 and I have checked for jar files (inhouse).
I dont see any error mark on the import statements, but the methods in one of our inhouse class are not recognizable by the main class where it uses those mehods to process the query statements.
The main class have imported four inhouse classes, only one class has this problem the others are working fine.
FYI,That inhouse class is an abstract class consists of four static methods with its implementations.There are no abstract methods.
we have our inhouse stuffs in utitlities package ,so I have included the corresponding jar files in the JCD.
I am really stuck at this, Please tell me what's going wrong here.
Regards
Preethi -
I am having trouble with my GUI class not recognizing methods from a STACK class from the same package. Here's the skinny:
I have a GUI class named WordGUI.
I hava a STACK class named WordStack.
within WordGUI I instantiate an instance of a WordStack and call it myStack. Example below:
WordStack myStack = new WordStack();
When I call WordStack methods from WordGUI I get the error message even though display is a method from WordStack:
"WordGUI.java": Error #: 300 : method display(java.awt.Graphics, int) not found in class assign4.WordStack at line 34, column 13
Complete code for both classes is below:
WordGUI class:
package assign4;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class WordGUI extends Applet implements ActionListener{
WordStack myStack = new WordStack();
private Button testButton;
private TextField wordField;
public void init(){
//add(myStack);
wordField = new TextField(20);
add(wordField);
wordField.addActionListener(this);
testButton = new Button("Test for palindromes");
add(testButton);
testButton.addActionListener(this);
}//init()
public void paint (Graphics g){
g.drawString("Enter a word in the textField above and click", 25, 100);
g.drawString("the button to check if the word is a palindrome", 25, 115);
myStack.display(g, 150);
}//paint()
public void actionPerformed(ActionEvent event){
if(event.getSource() == testButton){
String userInput = wordField.getText();
myStack.evaluate(userInput);
repaint();
}//actionPerformed()
}//class WordGUI
WordStack class:
package assign4;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class WordStack implements Cloneable{
private char[] data;
private int manyItems;
public WordStack(){
final int initialCapacity = 20;
manyItems = 0;
data = new char[initialCapacity];
}//generic constructor
public WordStack(int initialCapacity){
if(initialCapacity < 0){
throw new IllegalArgumentException
("initialCapacity too small: " + initialCapacity);
manyItems = 0;
data = new char[initialCapacity];
}//constructor
public int getCapacity(){
return data.length;
}//getCapacity()
public boolean isEmpty(){
return (manyItems == 0);
}//isEmpty()
public char pop(){
if(manyItems == 0){
//throw new EmptyStackException();
return data[--manyItems];
}//pop()
public void push(char item){
if(manyItems == data.length){
ensureCapacity(manyItems * 2 + 1);
data[manyItems] = item;
manyItems++;
}//push()
public void ensureCapacity(int minimumCapacity){
char biggerArray[];
if(data.length < minimumCapacity){
biggerArray = new char[minimumCapacity];
System.arraycopy(data, 0, biggerArray, 0, manyItems);
data = biggerArray;
}//ensureCapacity()
public String evaluate(String userInput){
char charToProcess;
for(int charNum = 0; charNum < userInput.length(); charNum++){
push(userInput.charAt(charNum));
}//evaluate()
public void display(Graphics g, int yLoc){
for(int i = 0; i < data.length; i++){
g.drawString("" + data, 25, yLoc);
yLoc += 15;
}//display()
}//class WordStack
Any help would be appreciated greatly. Thank youyou need to make your graphics call against the GUI object
-
Error of method not found in C# class in VS 2013 on win7
I am changing a C# code in a solution (it has many files and projets) from VS 2013 on win 7.
I added some properties in class1. It was built well.
But, it has run-time error:
Method not found : class1.set_p1(system.string)
The code logic is as follows:
public class class1
public string p1 {get; set;} // **have updated**
class1 is defined in a C# project that has been added in the solution.
public abstract class class2 : class1
class2 ins2;
ins2.p1 = myData.order.data_file; // myData is from an xml file after deserialize and serialize, data_file is a file path.
I have cleaned up the solution before building. I have also search the error online but none of them can solve my problems.
Any help would be appreciated.Check your dependencies in your projects. I understand the project was added to the solution but was it also added to the projects that will be 1. implementing/inheriting types from that project and 2. consuming types from that project
Check your name spaces to make sure that the type class1 is not also defined in another namespace in that or even a different project. In that case class1 might not have that property available because its pointing to the wrong type.
If that does not solve your problem it would be helpful to include.
the fully qualified namespaces of the types in your type hierarchy that are giving you the problem
the full calling code, the sample above is not correct in syntax.
the project dependencies for the code in question and where the types are located in each project
Mark as answer or vote as helpful if you find it useful | Igor -
Method init not found in class oracle.apps.fnd.cp.request.C
Hi all,
I am reffering to Oracle Application Framework Developers Guide Release
11.5.10 RUP3 December 2, 2005
As given in the document (page 275) Concurrent Processing: Request Submission
and Monitoring ,I want the Concurrent Processing Request Submission and Monitoring user interfaces available on my OA Framework-based pages.
I have followed the steps given in the OADevGuide but when the custom CO
is compiled it gives following error.
method <init> not found in class oracle.apps.fnd.cp.request.ConcurrentRequest.
The import statement in our code is as followed
import oracle.apps.fnd.cp.request.ConcurrentRequest;
import oracle.apps.fnd.cp.request.RequestSubmissionException;
wheather I have to open a SR on metalink asking for an updated file ConcurrentRequest.class ?
Thanks in advance,
Anant.Hi All,
Thanks Prabhat for that update.
Thanks tapashray cause u r update on thread Apply not being caught in debugger helped me a lot.
Right now I am facing a different problem.
On click of submit button The page gets called but it gives error as
oracle.apps.fnd.framework.OAException: Could not load application module 'oracle.apps.fnd.cp.srs.server.RequestAM'.
In myprojects folder under oracle dir at reqd path I have this AM .
Whether I need to add the bc4j pkg "oracle.apps.fnd.cp.srs.server.RequestAM" in my project . I dont think so as I am not extending any class/VO or doing any substitution.
my code is as followed
public void processFormData(OAPageContext pageContext, OAWebBean webBean)
System.out.println("Inside ProcessFormData");
if (pageContext.getParameter("Submit")!= null )
System.out.println("Inside Submit ");
try
// get the JDBC connection
OAApplicationModule am = pageContext.getApplicationModule(webBean);
//Connection conn = (Connection)am.getOADBTransaction();
OADBTransaction conn = am.getOADBTransaction();
System.out.println("OADBTransaction conn "+conn);
ConcurrentRequest cr = new ConcurrentRequest(conn.getJdbcConnection());
System.out.println(" ConcurrentRequest cr "+cr);
cr.setDeferred();
// call submit request
Vector param = new Vector();
String selectedValue = pageContext.getParameter("reportList");
System.out.println("selectedValue -> "+selectedValue);
param.add(selectedValue);
System.out.println("before cr.submitRequest ");
int reqId = cr.submitRequest("SQLGL", "RGFSGXML", "Run FSG and XML Publisher",null, false, param);
// int reqId = cr.submitRequest("SYSADMIN", "FNDSCURS", "User Responsibility Report",null, false, param);
System.out.println("After cr.submitRequest reqId "+reqId);
conn.commit();
System.out.println("After commit");
// redirect page to Request Scheduling page
HashMap parameters = new HashMap();
String url = "OA.jsp";
parameters.put("akRegionApplicationId", "0");
parameters.put("akRegionCode", "FNDCPPROGRAMPAGE");
String id = "" + reqId + "";
parameters.put("requestMode", "DEFERRED");
parameters.put("requestId", id);
System.out.println("before page forward ");
pageContext.setForwardURL("BSE_CONC_REQUEST"
,OAWebBeanConstants.KEEP_MENU_CONTEXT
,null
,parameters
,true
,OAWebBeanConstants.ADD_BREAD_CRUMB_NO
,OAWebBeanConstants.IGNORE_MESSAGES);
catch(RequestSubmissionException reportError)
System.out.println("RequestSubmissionException raised "+reportError.getStackTrace());
catch(SetDeferredException deferred)
System.out.println("SetDeferredException raised "+deferred.getStackTrace());
super.processFormData(pageContext,webBean);
Hope I have given all the details.
Regards,
Anant.
Message was edited by: Removed the error stack so that thread details remain on the same page
Anant -
I have uploaded my Application which was running fine in other IDE to jdev 10.1.3, when i compile the follwing error error in jsp page.
Error(400,8): method include(java.lang.String, boolean) not found in class javax.servlet.jsp.PageContext
My jsp code where error is shown is
<jsp:include page="querySections/generation.jsp" flush="true">
<jsp:param name="TSN" value="<%=strParamValue[1]%>"/>
<jsp:param name="SectionID" value="<%=String.valueOf(lngSectionID)%>"/>
</jsp:include>
pl help me in solving this its urgent...
Thanks & Regards
LakshmiHi,
code snippet looks okay and is identical with what JDeveloper generates.
Frank -
UI Error 'Method clone not found in class java.lang.Class'
When attempting to view an application window in the User Interface error I receive the error 'Method clone not found in class java.lang.Class'. The window will run correctly when I execute the application and other objects on the window are displayed correctly in the UI editor.
Within the window class I have used the following line of code to clone a reference list of values that is loaded just once when the application starts up: -
dsDefaultComboBoxModel priorityComboBoxModel = (dsDefaultComboBoxModel) dsReferenceLuLists.priorityComboBoxModel.clone();
And then this line of code to create a combo box: -
dsGuiComboBoxRefelu priorityComboBox = new dsGuiComboBoxRefelu(priorityComboBoxModel,ReportWindowSql.priorityCodeBuffer);
And then later on the combo box is displayed.
detailsArea.add(priorityComboBox, new XYConstraints(250,10,dsGlobalVariables.gvFieldWidthLarge,-1));
'dsDefaultComboBoxModel' is defined as follows: -
public class dsDefaultComboBoxModel extends DefaultComboBoxModel implements Cloneable
public dsDefaultComboBoxModel()
public Object clone()
try
return super.clone();
catch ( CloneNotSupportedException e )
// Shouldn't happen.
throw new InternalError( e.toString() );
This error occurs using the latest v903, but was also present in previous versions of JDeveloper.
At the moment this means that I did to execute the window in order to see all of the GUI elements that are displayed. As on option I could use something other than the clone method, but it seems to be such a nice way of copying the static reference lists.
Thanks for any help.Hi Darren,
My guess is that since DefaultComboBoxModel doesn't implement Cloneable, you can't call super.clone(). Does your code compile?
Later.
Dennis -
Hi , when i try to run my program, i keep getting the error msg:
Error(23,19): method getName(java.lang.String) not found in class javax.swing.JTextField
I have checked the java API and it inherits from the awt.Component class and should be accessible via the jtextfield.
I have tried the following:
trying to initailise the JTextField at the start.
Using getName works if i use it within the loop after setting the name.
Does anybody know what i am doing wrong please?
public class clsMember extends JPanel implements ActionListener {
private JButton jbtnLog;
private String surname;
private JTextField txtItem;
public clsMember() {
super(new SpringLayout());
makeInterface();
surname = txtItem.getName("Surname").toString();
private void makeInterface() {
//code omitted
for (int i = 0; i < numpairs; i++) {
JLabel l = new JLabel(strLabels, JLabel.LEADING);
this.add(l);
//if the array item is salutation create a combobox
if (strLabels[i] == "Salutation") {
jcomSalutation = new JComboBox(strSalutation);
jcomSalutation.setSelectedIndex(0);
this.add(jcomSalutation);
} else {
txtItem = new JTextField(10);
l.setLabelFor(txtItem);
txtItem.setName(strLabels[i].replaceAll(" ", "")); //this is where the label is set and if i do a system.out it shows fine. getName works here too.
this.add(txtItem);
//code omittedIf i have a loop that creates the jtextfields such as
txtItem = new JTextField(10);
l.setLabelFor(txtItem);
txtItem.setName(strLabels.replaceAll(" ", ""));
this.add(txtItem);How is it then possible to assign to a string the value of a *specific jtextfield*. Lets say that one of these JTextfields has the name surname.
How is it possible for me to writeString surname = surnamejtextfield.getText(); -
GetAudioClip() not found in class . Help !
Dear People,
I have one error message "getAudioClip() not found in class.
I investigated in the AppletContext interface for the signature of the
method. It says that the signature of the "getAudioClip()" method has
one parameter. That parameter is the url which has the audio clip.
I did include the address to the audio clip presently on my hard drive
c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk
below is the program
Thank you for your advice
Norman
import java.util.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;
import java.applet.*;
import java.awt.event.*;
public abstract class MyMusicApplet_1 extends JApplet implements ActionListener, AppletContext
//AppletContext myAppletContext = new AppletContext();
//Iterator i = myAppletContext.getStreamKeys();
JButton myJButton;
AudioClip acSound_1 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk");
AudioClip acSound_2 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_3 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_4 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_5 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_6 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_7 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_8 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
AudioClip acSound_9 = getAudioClip("c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk ");
JButton myJButtonSound1;
JButton myJButtonSound2;
JButton myJButtonSound3;
JButton myJButtonSound4;
JButton myJButtonSound5;
JButton myJButtonSound6;
JButton myJButtonSound7;
JButton myJButtonSound8;
JButton myJButtonSound9;
public void init()
Container myContentPane = getContentPane();
myContentPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
Dimension buttonSize = new Dimension(190,100);
Font myFont = new Font("Arial", Font.BOLD,14);
Border myEdge = BorderFactory.createRaisedBevelBorder();
//create 1st button's object
myJButtonSound1 = new JButton("sound #1");
myJButtonSound1.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound1.setBorder(myEdge);
myJButtonSound1.setPreferredSize(buttonSize);
myJButtonSound1.setFont(myFont);
myJButtonSound1.setBackground(Color.orange);
myJButtonSound1.setForeground(Color.black);
//create 2nd button's object
myJButtonSound2 = new JButton("sound #2");
myJButtonSound2.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound2.setBorder(myEdge);
myJButtonSound2.setPreferredSize(buttonSize);
myJButtonSound2.setFont(myFont);
myJButtonSound2.setBackground(Color.blue);
myJButtonSound2.setForeground(Color.black);
//create 3rd button's object
myJButtonSound3 = new JButton("sound #3");
myJButtonSound1.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound3.setBorder(myEdge);
myJButtonSound3.setPreferredSize(buttonSize);
myJButtonSound3.setFont(myFont);
myJButtonSound3.setBackground(Color.cyan);
myJButtonSound3.setForeground(Color.black);
//create 4th button's object
myJButtonSound4 = new JButton("sound #4");
myJButtonSound4.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound4.setBorder(myEdge);
myJButtonSound4.setPreferredSize(buttonSize);
myJButtonSound4.setFont(myFont);
myJButtonSound4.setBackground(Color.pink);
myJButtonSound4.setForeground(Color.black);
//create 5th button's object
myJButtonSound5 = new JButton("sound #5");
myJButtonSound5.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound5.setBorder(myEdge);
myJButtonSound5.setPreferredSize(buttonSize);
myJButtonSound5.setFont(myFont);
myJButtonSound5.setBackground(Color.red);
myJButtonSound5.setForeground(Color.black);
//create 6th button's object
myJButtonSound6 = new JButton("sound #6");
myJButtonSound6.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound6.setBorder(myEdge);
myJButtonSound6.setPreferredSize(buttonSize);
myJButtonSound6.setFont(myFont);
myJButtonSound6.setBackground(Color.pink);
myJButtonSound6.setForeground(Color.black);
//create 7th button's object
myJButtonSound7 = new JButton("Choice #7");
myJButtonSound7.addActionListener(this);
//set the button's border and size, font, background and foreground
myJButtonSound7.setBorder(myEdge);
myJButtonSound7.setPreferredSize(buttonSize);
myJButtonSound7.setFont(myFont);
myJButtonSound7.setBackground(Color.cyan);
myJButtonSound7.setForeground(Color.black);
//create 8th button's object
myJButtonSound8 = new JButton("Choice #8");
myJButtonSound8.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound8.setBorder(myEdge);
myJButtonSound8.setPreferredSize(buttonSize);
myJButtonSound8.setFont(myFont);
myJButtonSound8.setBackground(Color.yellow);
myJButtonSound8.setForeground(Color.black);
//create 9th button's object
myJButtonSound9 = new JButton("Choice #9");
myJButtonSound9.addActionListener(this);
//set the button's border and size, font background and foreground
myJButtonSound9.setBorder(myEdge);
myJButtonSound9.setPreferredSize(buttonSize);
myJButtonSound9.setFont(myFont);
myJButtonSound9.setBackground(Color.blue);
myJButtonSound9.setForeground(Color.black);
//add the buttons to the content pane
myContentPane.add(myJButtonSound1);
myContentPane.add(myJButtonSound2);
myContentPane.add(myJButtonSound3);
myContentPane.add(myJButtonSound4);
myContentPane.add(myJButtonSound5);
myContentPane.add(myJButtonSound6);
myContentPane.add(myJButtonSound7);
myContentPane.add(myJButtonSound8);
myContentPane.add(myJButtonSound9);
public void actionPerformed(ActionEvent e)
myJButton = (JButton)e.getSource();
if(myJButton == myJButtonSound1)
acSound_1.play();
if(myJButton == myJButtonSound2)
acSound_2.play();
if(myJButton == myJButtonSound3)
acSound_3.play();
if(myJButton == myJButtonSound4)
acSound_4.play();
if(myJButton == myJButtonSound5)
acSound_5.play();
if(myJButton == myJButtonSound6)
acSound_6.play();
if(myJButton == myJButtonSound7)
acSound_7.play();
if(myJButton == myJButtonSound8)
acSound_8.play();
if(myJButton == myJButtonSound9)
acSound_9.play();You are passing a String. A String is not an instanceof the URL class. Look at the java.net.URL class. Dear BBrita,
I looked at the URL class in the Java API and did not find anything that told me how to pass the URL
"c:/Program Files/Cakewalk/Cakewalk Pro Audio 9/seashore.wrk"
which is stored on my hard drive.
Thank you in advance
Norman -
Codebase help. Applet class not found. Please help..
I have web application (WEB) and struts configuration on weblogic server. I have configured the struts xml to call a HTML under certain condition and the HTML in turn should load a applet. The HTML is getting called correctly but the applet fails to load.
My html is in the C:\xxx\yyy\web\billing directory and the applet class is in the
C:\xxx\yyy\web\WEB-INF\classes\com\zzz\kkk\jjj\billing\helper directory. The Applet class is in the package com\zzz\kkk\jjj\billing\helper . I tried all combination of codebase in the HTML but the applet is NOT FOUND.
Any help would be appreciated.
Thanks>
The browser needs to grab the applet class, so it can
execute it locally.
I think that stuff in WEB-INF is never directly
delivered to the client -- the server denies that it
exists.
So create another directory under docroot that will
hold applet classes.Thanks. I moved the applet class to the same directory as the HTML file and it works now. -
Logger.getLogger(myaction.class) method not found
Hey, I want to use
Logger logger = Logger.getLogger(myaction.class).
I'm using JDev 10.1.2. I have added the log4j library in my project. But, I still not able to use getLogger(class).
Logger class works but getLogger(myaction.class) is not found. Please help me to resolve this.Hey, I want to use
Logger logger = Logger.getLogger(myaction.class).
I'm using JDev 10.1.2. I have added the log4j library in my project. But, I still not able to use getLogger(class).
Logger class works but getLogger(myaction.class) is not found. Please help me to resolve this.
Maybe you are looking for
-
How do I connect my Time Capsule to an Existing Network?
I've seen a few similar discussion threads and seem to suggest I can't do this without an Apple Router, but I just want to clarify: I have a 3TB Time Capsule, I want to connect it to my existing Wireless Network so that I can set it up with Time Mach
-
Ok, I suffer from the self assigned ip nightmare that so many face! But still there is no word from your official site on how to fix this! I gave up using my PC that was assigned to me at my work place. I brought my mac and since then it has been not
-
Free SMTP server for Java mail testing
Hi all, Are there any free SMTP servers that can be downloaded from the Net for Java mail. Thanks. Regards Ram
-
tunes is stating that my ipod has space but when i sync it itunes says i need an additional 1.32GB
-
Where do I go to download Production Premium CS6 after I had to replace my hard drive.
I need a little help here. My primary C:\ drive was getting slower and slower and it is over five years old. So I decided to replace it with an SSD. I log in and went to the support and found the download section. I found all my license and serial