Hi, I'm considering writing a java applet that has a chess board and lets people solve puzzles. There are chess engines that are free that could be the AI to play against and they come in executable files (console apps) compiled for both Mac and Windows. Now i have a java stand alone chess board program that lets the user open engines and play against them they own on their computer using Runtime(); If i did an applet because i want it on a web page coudl i package one of these engines( its maybe 250 kilobytes) into the java …

Member Avatar
Member Avatar
+0 forum 5

I have the following form that works: http://craigcoleman.com/java/julia/ I'm trying to do the same thing with this form and I can not get the parameters to work with the form. I am using java script to get the parameter values. Please throw me a bone. <html><head><title> Test New </title> </head> <body> <center> <form name="tn" method="post" onSubmit="return false;" > COLOR START (0 TO 255)<br /> red start:<input type="text" size="4" name="red" value="8"><br /> green start:<input type="text" size="4" name="green" value="88"><br /> blue start:<input type="text" size="4" name="blue" value="-88"><br /> <br /> COLOR END (0 TO 255)<br /> red end:<input type="text" size="4" name="redAjust" value="9"><br /> …

Member Avatar
Member Avatar
+0 forum 2

i am confuse about `paint()` method in applet .The confusion is that paint method is getting object as parameter of Graphics class like this `public void paint(Graphics g)` and i read that the Graphics class is an abstract class then how we create object of Graphics class and now you will say that g in Graphics g is reference not actual object and we can create reference of abstract class i know this but g is a reference not object then how can we call a class member with reference object same like this `g.drawString("hello world",15,30)` this is out of …

Member Avatar
Member Avatar
+0 forum 12

first se these methods setForeground(Color.cyan); setBackground(Color.red); these methods are defined in Component class like this java.awt.Component and we pass parameters of an other class this is very confusable for me that we pass class members as parameters to method of a different class, i mean `setForeground(Color.cyan)` i defined in Component class and this method is pass parameters of different class how it is possible plz plz plz plz plz plz give me key concept about this.i will be very thankfull to all members of this forum and management.

Member Avatar
Member Avatar
+0 forum 10

i am very confuse about java applets so please solve my questions my question is that when we write applet then we write only methods defination not method calling so i am confuse about this that who call the methods of applets.and second is that we call the methods of other class by two ways first with object and second with class name but in applets we call some methods without object and without class name for example setForeground(Color.cyan); setBackground(Color.red); these methods call without anything so how should be calling methods with this syntax. my english is very poor so …

Member Avatar
Member Avatar
+0 forum 9

` Hey can u solve my prob. I was running an Applet program(.html file) with java Browser but it showing error = "your security settings have blocked a local application from running" So can u say ... which application is this

Member Avatar
Member Avatar
+1 forum 5

I want to make a project on online examination which have some similar view like amcat and also have a view which run programs online.

Member Avatar
Member Avatar
+0 forum 2

Hi to all, I have following two Applets . import java.applet.*; import java.awt.*; import java.awt.event.*; public class buttonDemo extends Applet implements ActionListener { String msg=""; Button one,two,three; public void init() { one=new Button("One"); two=new Button("Two"); three=new Button("Three"); add(one); add(two); add(three); one.addActionListener(this); two.addActionListener(this); three.addActionListener(this); } public void actionPerformed(ActionEvent ae) { String str=ae.getActionCommand(); if(str.equals("One")) { msg="You pressed one"; } else if(str.equals("Two")) { msg="You pressed two"; } else { msg="You pressed three"; } repaint(); } public void paint(Graphics g) { g.drawString(msg,10,20); } } And import java.awt.*; import java.applet.*; public class appletDemo extends Applet { String msg; public void init() { appletDemo a= new …

Member Avatar
Member Avatar
+0 forum 4

Basically i'm looking for tutorials on how to create your own pert char in java (applet) to show dependencies? Any tutorials on that please?

Member Avatar
+0 forum 0

Hello to all, I have following simple Applet program. import java.applet.*; import java.awt.*; public class myapp1 extends Applet { Label l1, l2, l3, l4; TextField t1; TextArea t2; Checkbox c1,c2,c3,c4,c5,c6; CheckboxGroup cg; Button b; public void init() { l1=new Label("Enter your name: ", Label.RIGHT); t1=new TextField(20); l4= new Label("Enter your gender: "); cg=new CheckboxGroup(); c5=new Checkbox("Male",cg,true); c6=new Checkbox("Female",cg,false); l2=new Label ("About Workshop: "); c1=new Checkbox("Timely Completion"); c2=new Checkbox("Excellent Resourse Persons", true); c2.setEnabled(false); c3=c1=new Checkbox("Good Food"); c1=new Checkbox("Excellent Hospitality"); l3=new Label("Any other comment:"); t2=new TextArea(10,20); b=new Button("OK"); b.setForeground(Color.blue); add(l1); add(t1); add(l4); add(c5); add(c6); add(l2); add(c1); add(c2); add(c3); add(c4); add(l3); add(t2); add(b); …

Member Avatar
Member Avatar
+0 forum 2

Hi I am creating a java applet for an assignment, but if hit a snag. I have had to create a sales table for different sales people. I have made it that people can click "sales person 1" and it will display his sales. The issue is when you click the button it opens in a new applet window. This is how i have coded it to get it working, but instead i now want the information to go into a text box, rather than a new pop up window. This is my code: http://pastebin.com/z44RGuiW Thanks for any help

Member Avatar
+0 forum 0

Hello everyone, I'm having some issues with my rock, paper, scissors JApplet program. Of course I have it "extends Applets" from the beginning of my class and I realized that this wasn't the same as JApplet. After I changed "Applet" to "JApplet", when I ran it, it doesn't look like of what I had before I changed it to "JApplet". When I have "Applet", everything looks fine. So I'm assuming I need to change something around within my code. Here is my code and please let me know as to what I need to change for the program. [CODE] import …

Member Avatar
Member Avatar
+0 forum 4

This is for anyone who might find it helpful. This template... * uses double-buffering, which can help game-makers fix that glitchy screen problem * can be exported as a runnable jar file. If you're like me and had trouble making your Applet executable, this is a possible fix. * Additionally it resizes the interior of the frame, not the frame itself * is easily customizable. Take out or add in whatever you need to make it work, it's all yours package applet; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.Timer; @SuppressWarnings("serial") public class quasiApplet …

Member Avatar
Member Avatar
+0 forum 2

Hi. Our homework is to use try...catch block in our calculator applet. I don't understand why the "catch" does not work. It will always go straight to the "finally". Here's the code: import java.applet.*; import java.awt.*; import java.awt.event.*; import java.awt.Label; import javax.swing.*; public class clsCalculator extends Applet implements ActionListener { Label lblTitle= new Label("Standard Calculator"); Label lblFirst=new Label("Enter 1st Number: "); Label lblSecond=new Label("Enter 2nd Number: "); Label oper=new Label("Click the Operation: "); Label ans=new Label("The Answer is: "); TextField txtFirst = new TextField(5); TextField txtSecond = new TextField(5); TextField txtAns = new TextField(5); Button btnPlus=new Button("+"); Button btnSub=new Button("-"); …

Member Avatar
Member Avatar
+0 forum 3

Hi All, I have created a Java applet in Eclipse and ran it in eclipse, it works fine . To run the applet in Webbrowser it was mentioned to embed the .class file inside a webpage by creating a HTML file. My class name is MyFirstGUI. i have created a file name gui.html and saved it in my documents. The error im getting in browser when running the file is "ClassNotFoundException". This is the content of my html file . <HTML> <HEAD> <TITLE>Metric Conversion Helper</TITLE> </HEAD> <BODY> <APPLET code = “MyFirstGUI.class” width = “400” height = “120”> </APPLET> </BODY> </HTML> …

Member Avatar
Member Avatar
+0 forum 4

I can't figure out why my java applet is not displaying, I have all of the files in the same folder, and I have java enabled on my browser. Here is the code //java code import java.applet.*; import java.awt.*; import javax.swing.*; /** * The HelloWorld class implements an applet that * simply displays "Hello World!". */ public class HelloWorld extends Applet { private static final long serialVersionUID = 1L; public void init() { //Third thing - Change applet size (Also background color is included) setSize(500, 500); } public void paint(Graphics g) { g.setColor(Color.cyan); g.fillRect(0, 0, 500, 500); int x; String …

Member Avatar
Member Avatar
+0 forum 1

Hi This code not run : it show this error: incompatible types-found java.lang.String but expected HuffmanCodingAnimation.Node This line of code ` root.left.code = root.code + "0";` Here is the code: import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.tree.*; /* * This program enables a user to enter text and displays the Huffman coding tree based on the entered text. * * The display shows the weight of the subtree inside a subtree's root circle. The character is displayed at each leaf node. * The encoded bits are displayed for the text in the dialog box. * The decoded text button …

Member Avatar
Member Avatar
+1 forum 3

Hi friends, I am using java applet that will perform some operations. Now it is independent of jsp or html page. So,if i close an applet my html page remains active and Vice-Versa. What i want to do is embed an java Applet in html page itself. When i click on LOGIN BUTTON on login.htm page. That should invoke one method called PopUpAtt() which is in another jsp page(applet.jsp). In order to implement it,what i am doing is I just created one more jsp page called applet.jsp that contains my applet invoking code as like follows,(I have Given this code …

Member Avatar
Member Avatar
+0 forum 7

hi!guys i hope you all will be fine . Today i want to know from you about the Java Application? According to my views or my knowledge may be i am wrong.There are two types of application in java which is **1. Java Stand-alone Application 2. Java Applet Application** I think for execution of Applet web-Browser is necessary.. so i have not know enough information about java Applet and java stand-alone application ..so i share your knowledge about that and enhace my knowledge also the others ........thanks for reading

Member Avatar
Member Avatar
+2 forum 2

** //When an item from the list is selected, a checkbox along with the drawn graphics schould appear. but only the graphics appear. Help? *basic** import java.awt.*; import java.applet.*; import java.awt.event.*; import java.awt.Checkbox; public class GetSelectedItemExample extends Applet implements ItemListener { Choice c; CheckboxGroup g1 = new CheckboxGroup(); Checkbox checkBox1 = new Checkbox("Red"); public void init() { c = new Choice(); c.add("Select Option"); c.add("Primary Colors"); c.add("Secondary Colors"); c.add("Tertiary Colors"); add(c); c.addItemListener(this); add(checkBox1); checkBox1.setVisible(false); } public void itemStateChanged(ItemEvent e) { repaint(); } public void paint(Graphics g) { String s1 = c.getSelectedItem(); if(s1 == "Primary Colors") { g.drawString("You have chosen:"+c.getSelectedItem(),100,100); g.setColor(Color.RED); g.drawRect(90,120,100,100); …

Member Avatar
Member Avatar
+0 forum 9

Just a simple Jython code to test drawing on the canvas.

Member Avatar
+3 forum 0

Hi. I have a problem with launching my application as applet. The game runs fine as an application. my applet code: package net.viped.breakout; import java.applet.Applet; import java.awt.GridLayout; public class GameApplet extends Applet { Core core = new Core(); public void init() { setLayout(new GridLayout()); add(this.core); } public void start() { core.start(); } public void stop() { core.stop(); } } error: javax.imageio.IIOException: Can't read input file! at javax.imageio.ImageIO.read(ImageIO.java:1275) at net.viped.breakout.ImageLoader.<init>(ImageLoader.java:14) at net.viped.breakout.Core.<init>(Core.java:66) at net.viped.breakout.GameApplet.<init>(GameApplet.java:8) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at sun.applet.AppletPanel.createApplet(AppletPanel.java:807) at sun.applet.AppletPanel.runLoader(AppletPanel.java:714) at sun.applet.AppletPanel.run(AppletPanel.java:368) at java.lang.Thread.run(Thread.java:680) Code causing error: public ImageLoader() { …

Member Avatar
Member Avatar
+0 forum 4

Create an applet for a calculator application in java program

Member Avatar
Member Avatar
+0 forum 1

So this is going to be the last project for my java class. Any input is appreciated and I'm generally posting it here because someone else might benefit from it. It is not done yet but when it is I'm going to post the full code. I made a video about this u can see it here: https://www.youtube.com/watch?v=wWmsXcuW6FE The ball class: /* * This is the Ball class */ public class Ball { //variables for the x and y position private int xPos,yPos; //the direction of the x and y position. Dy is set to -5 because, //remeber that the …

Member Avatar
+0 forum 0

**This program is supposed to read data in from a file into an array list and everything compiles correctly so far but when i go to run the applet ProcessNovels it shows a blank window saying "Start: applet not initialized? Im not sure where the problem actually is i am a beginner programmer < SORRY SO LENGTHY > ** **Heres my code for ProcessNovels** import java.awt.*; import javax.swing.*; import java.util.Scanner; import java.io.*; import java.io.IOException; import java.awt.Color; import java.awt.Font; import javax.swing.ImageIcon; import java.util.*; /** * Class ProcessNovels - program that reads noels from a file and displays them using an Applet …

Member Avatar
Member Avatar
+0 forum 1

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(); frame.show(); } //========================= //Varible section //========================= private Image i; //Varible saying whats on the screen private Graphics doubleG; //double buffer photocopy graphic //These are made private to make sure //Its overiding correctly. ball b; //A ball named b. platform p[] = new platform[7]; // a platform array named p. Item …

Member Avatar
Member Avatar
+0 forum 5

note x = player x postion y = player y postion so iam trying to set up collsion between player and enemy. i want it so my player touch the enemy than my player should stop. and not go though it. this code below kind of works. if my player stand on left side of enemy than collsion work. but if my player stand is on right side of enemy than it dont work. i belive the problem is in statment: ` [CODE] x = enemyX - 13;[/CODE] ` like i said, if my player stand on left side it …

Member Avatar
Member Avatar
+0 forum 6

I have two classes: (1) **Class A**, which extends JApplet, implements Runnable + some Listener stuff (2) **Class B**, which has a main method and is not an applet My question is, how do I create **class A** with **class B**'s main method? Is this even possible? What I'm doing right now (and this may be totally wrong because I'm still an amateur) is the following: public class classB { static classA applet; public static void main(String[] args){ //misc. applet = new classA(); applet.init(); } //misc. } The problem is, the applet isn't showing up. Using some *System.out.println()* lines, I'm …

Member Avatar
Member Avatar
+0 forum 1

import javax.swing.*; import java.awt.*; import java.text.*; import java.awt.event.*; public class SchoolApplet8 extends JApplet implements ActionListener { double userAmount; double userInterest; double userTerm; int month = 0; double remainBalance = 0; double interestPayment = 0; double principalPaid = 0; JPanel row1; JLabel lblAmount; JTextField txtAmount; JLabel lblInterest; JTextField txtInterest; JLabel lblTerm; JTextField txtTerm; JLabel lblMonthlyPayments; JTextField txtMonthlyPayments; JLabel lblPayment; JTextField txtPayment; JPanel row2; JLabel lblHeader; JTextArea txtResults; JScrollPane textPane; JPanel row3; JButton calculateButton; JButton clearButton; JButton exitButton; public void init() { //Instantiate GUI Components // row1 row1 = new JPanel(); lblAmount = new JLabel(" Loan Amount: $", JLabel.LEFT); txtAmount = new …

Member Avatar
Member Avatar
+0 forum 6

Hello, iv looked around google and have found it is possible to put an applet into a jframe. The problem i am having is that my applet is to be hosted online, what i want is to take the applet that is online and display it from a swing or awt front end. Can anyone link me or tell me if it is possible to make a jframe download/embed the applet via url into a jframe or generic window?

Member Avatar
Member Avatar
+0 forum 1

The End.