japplet

JTable not rendering JCheckBox or JComboBox in the table in Java Applet

丶灬走出姿态 提交于 2019-12-13 08:20:43
问题 Im having trouble getting my JTable that im using to display either check boxes or combo boxes in my applet. Here is the code that is not working correctly String[] options = {"download", "ignore"}; Object[] obj = {new JComboBox(options), ((MetadataList)array.get(1)).getMetadata("Filename").getValue()}; defaultTableModel2.addRow(obj); The defaultTableModel2 is simply a DefaultTableModel defaultTabelModel2 = new DefaultTableModel() so nothing too dramatic there. The code above is using a

Trouble with JApplets and calling paint/paintComponent

孤街浪徒 提交于 2019-12-13 06:27:42
问题 So I'm just doing some studying for finals here, and I'm having trouble getting this to work. What I have always done previously is call paintComponent(Graphics g) and things have worked just peachy. But now I'm getting a "paintComponent has protected access in JComponent" error when I go to compile. The only way I could get it to compile was to tell it to call paint. But even if it compiles, paint never gets called in the applet window. What am I not seeing here? public class LineDraw

Presence of constructor in an applet throws exception

拥有回忆 提交于 2019-12-12 14:52:03
问题 I'm running the below applet . In it, the moment I add the constructor ( even empty ), the applet throws a runtime exception: MainFrame.class can't be instantiated, java.lang.InstantiationException If I remove the constructor, no exception in thrown. Can't I have a constructor present in an applet? public class MainFrame extends JApplet implements WindowListener, ActionListener { public void init() { System.out.println("Applet Step1"); String[] args = null; createAndShowGUI(args); } private

JFrame on website

强颜欢笑 提交于 2019-12-12 04:44:31
问题 I have an application which is composed of many JFrame objects (using Java and Netbeans). The 'main' frame has 4 buttons and each button opens another frame. Now my problem is that I want the whole application to be run on the web as a website. I was considering 3 possible scenarios (from my research): Use Java Web Start Convert JFrame to JApplet Create from scratch a Java web application I was hoping that maybe someone can give me some help, and guidelines of which option I should opt for.

Using ActionListener to update variables in other classes

青春壹個敷衍的年華 提交于 2019-12-12 03:06:32
问题 I am designing an applet so it allows a user to plot a graph. I am having problems to construct a code which from another file (ControlsB.java) the variables in the Graph.java file are updated. Below is my code: import java.awt.*; import javax.swing.*; public class Calculator extends JFrame{ /** * */ private static final long serialVersionUID = 1L; private static final int HORIZONTAL_SCROLLBAR_NEVER = 0; private static final int VERTICAL_SCROLLBAR_ALWAYS = 0; public static void main (String[]

Using external Jar dependency in Eclipse with Non-Runnable Jar

会有一股神秘感。 提交于 2019-12-12 02:34:46
问题 I am making a Jar file in Eclipse to run an Applet, and the program uses an external jar file (jxl.jar). When I run the applet, it tells me it can't find the jxl files I am trying to use. When I make the jar file, I right click the project and select Export and then JAR file. I don't see an option in the dialog that comes up to include dependencies. How can I ensure that it is including my external jar file, which is added to the external Java Build Path as an External Jar file in my Project

When is Applet.stop() called?

本秂侑毒 提交于 2019-12-11 16:51:37
问题 I experiment with my applet using Eclipse and its Applet Viewer. The Applet Viewer appears on the top of Eclipse and during Applet execution I click on Eclipse icon to maximize it from task bar. Then Applet Viewer loses the focus and Applet.stop() gets called. When I minimize Eclipse, Applet Viewer goes to front again, gains focus and Applet.start() gets called. This ends up in a complete mess. Is it normal behavior for a browser to call Applet.stop once user changes to another Tab or

Drawing with graphics and with widgets in JApplet/Swing?

荒凉一梦 提交于 2019-12-11 13:04:06
问题 Basically I have a JApplet that tries to draw with the graphics (ie, g.drawOval(10,10,100,100) and also include JCompotents (ie. JButton). What happens is that the repaint can get really wacky. Sometimes the graphics will draw over widgets or vis-versa. It's not reliable and leads to unpredictable behavior. (Button also always be on top of those graphics) I've played around with it trying to override or manually draw components, changing orders, etc, but think I'm missing something very

Java Applet cannot parse Json

若如初见. 提交于 2019-12-11 12:04:10
问题 I'm developing a web server in Django, and in a page, I embed a Java Applet. I have to pass to this applet a JSon array at the moment of instantiation. NO problems at all, I've tested it in Eclipse with no errors or problems. The big problems came out when I put this on the web page. First I tried with Jackson, here is the code on the page: <applet name="mapGenerator" id="mapGenerator" code="main.MapGenerator.class" archive="{{STATIC_URL}}jar/MapGenerator.jar, {{STATIC_URL}}jar/plugin.jar {

JApplet fails to run in HTML page

扶醉桌前 提交于 2019-12-11 10:51:13
问题 I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing. My class is : public class View extends JApplet { //Here I declare the buttons etc.. public View() { initializeComponent(); fetchGraphs(); } public static void main(String[] args) throws IOException{ f = new JFrame(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize