japplet

Difference between JPanel, JFrame, JComponent, and JApplet

ぐ巨炮叔叔 提交于 2019-12-02 16:04:54
I'm making a physics simulator for fun and I was looking up graphics tutorials when I tried to figure out the difference between all these J's. Can somebody elaborate on them or perhaps provide a link to a helpful source? Those classes are common extension points for Java UI designs. First off, realize that they don't necessarily have much to do with each other directly, so trying to find a relationship between them might be counterproductive. JApplet - A base class that let's you write code that will run within the context of a browser, like for an interactive web page. This is cool and all

JDBC Connection: Access Denied for User even All Previlleges are Granted [closed]

你说的曾经没有我的故事 提交于 2019-12-02 12:59:20
I have an JApplet that connects to the database via this code: String url = "jdbc:mysql://localhost:3306/moodlele_survey"; String user = "moodlele_garanti"; String password = "garanti"; try { panel.add( new JLabel("before driver")); Class.forName("com.mysql.jdbc.Driver"); panel.add( new JLabel("failed")); Connection con = DriverManager.getConnection(url, user, password); The applet is signed, so it has the right to connect databases. The database user is granted all previlleges and the username, password and database name is correct because I can connect to the database via PHP with the very

Java Applet errors on Web Hosting site

我的梦境 提交于 2019-12-02 07:27:33
I am having problems trying to run my applet file when I upload it on my website. It keeps giving me errors, but works perfectly fine on my computer. I am using NetBeans to create my Applets and I used the <Applet> tag, since I remember using it and it worked. But NetBeans did state a warning message stating that the <Applet> tag has been deprecated and advised to use <Object> . Now this is where it gets a little harder for me, because I do not know how to use the <Object> tag for applets. I definitely searched for answers online. Each gives different ways of declaring it for an Applet, but

How to find if image is clicked in JApplet?

半城伤御伤魂 提交于 2019-12-02 07:13:20
问题 It is to support image dragging. How to find if an image is clicked in JApplet ? I'm sure there is an easy way to do this, but I've looked everywhere and cannot seem to find it. 回答1: Options: Use a JLabel to hold the image, and give it a MouseListener. Simple. Or create a JButtton and use the Image as the button's ImageIcon. Probably simpler. 回答2: See the Drag and Drop and Data Transfer lesson of the tutorial. If the purpose of the dragging is to change the order in a slideshow or similar,

How to set size of applet?

烂漫一生 提交于 2019-12-02 06:56:02
问题 I have written a little test applet and start the applet via Eclipse appletviewer. I have noted tag at the begginig of the code, but appletviewer doesn't see it. It starts the applet in standart window with the same size every time. I use JDK 1.7, Eclipse Kepler import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import javax.swing

How to set size of applet?

这一生的挚爱 提交于 2019-12-02 04:57:47
I have written a little test applet and start the applet via Eclipse appletviewer. I have noted tag at the begginig of the code, but appletviewer doesn't see it. It starts the applet in standart window with the same size every time. I use JDK 1.7, Eclipse Kepler import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JApplet; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; /*<applet

How to hide JDialog from JApplet when user switch browser tab?

ⅰ亾dé卋堺 提交于 2019-12-01 19:49:39
Problem: user starts long operation from applet; JDialog with progress bar is displayed. User open/switch to another browser tab - JDialog is still displayed (and annoys user). JDialog should be hidden when user switch to another tab; and displayed again, when user switch back. Note: I saw question with similar problem, where solution was add windowActivated/deactivated listener. It doesn't work for me, because there are multiple frames in window, and one of them contains applet. When user clicks on another frame, windowDeactivate event is casted, but user still in the same tab. Try specifying

Java JApplet to JFrame

一个人想着一个人 提交于 2019-12-01 12:35:19
I want to convert a JApplet to a JFrame. I have found this code on the internet that is a word search game. I want to use this code in a demonstration for a class. but I don't want it in an applet. The code that I was going to paste in here was to large by about 7,000 characters. I tried taking the JApplet and extending a JFrame and then putting all of the code for the initialization into a constructor (Zero Argument constructor). This cause about ten errors that I couldn't get fixed. I want to make a word search game and I had found a great example but I cannot get it to run in my Eclipse.

How to disable http caching in applet

淺唱寂寞╮ 提交于 2019-12-01 08:23:35
问题 How can i disable http caching of all my http connections in my japplet? I dont want any of my http (request/response)to be cached.Regardless of the user settings in control panel\java\Temporary File Settings. Applet is signed and compiled with java1.6. I am using URLConnection.class and my request to an 3rd party web service is being cached. ie: I can see my request url in Java Cache Viewer. http://www.service.com?param1=232&param2=2323232 Also i can find the responses in application ...

Convert JTextField input into an Integer

﹥>﹥吖頭↗ 提交于 2019-11-30 10:47:11
I am new to JAVA, I am trying to convert an input from a JTextField into an integer, I have tried loads of options but nothing is working, the eclipse is always giving me an error and the errors are not making sense to me. import java.awt.Graphics; import java.awt.Color; public class circle extends Shape{ public int x; public int y; public int Radius; public circle (int Radius, int x, int y, Color c){ super(c); this.x = x; this.y = y; this.Radius = Radius; } public void draw(Graphics g){ g.setColor(super.getColor()); g.fillOval(x-Radius, y-Radius, Radius * 2, Radius * 2); } } In place of: