We are using an applet in our web application. The applet of our application is dependent on bouncycastle jar,bcprov-jdk15.jar and few other jar's whose size comes around 4 mb. When using the appliaction on jre7, the applet is taking too long time to load than usual time. Is there any way to place these jar's in client machine? Will it improve the performance? Is there any other way to reduce the loading time of applet apart from placing jars in client machine?
We have a custom authorization in our application login page, authorization by using eToken and java (signed jar classes) and applet as login button on page. It's work fine on older and current java versions like 7u67, 7u71 but it's not work on new java version 8u25.
We write a test class named AuthControl without package, we found that problem is in .jar file path, for example:
&APPLET_VERSION. is a jar file name, uploaded using "Shared Components / Static Files - Create"
<script src="https://www.java.com/js/deployJava.js"></script> <script> var attributes = {code:'AuthControl', archive:'#WORKSPACE_IMAGES#&APPLET_VERSION.', width:132, height:37}; // problem in the path to the .jar file var parameters = { scriptable:true, mode:'login' }; var version = '1.6'; deployJava.runApplet(attributes, parameters, version); </script>
Error is: ... java.lang.ClassNotFoundException: AuthControl at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) basic: load: class AuthControl not found. ...
But if we use a direct path to the jar file, it's work fine without errors, example:
<script src="https://www.java.com/js/deployJava.js"></script> <script> var attributes = {code:'AuthControl', archive:'http://example.com/myapplet.jar', width:132, height:37}; var parameters = { scriptable:true, mode:'login' }; var version = '1.6'; deployJava.runApplet(attributes, parameters, version); </script>
The error I get is as follows...When the page is loaded I get the following error: java.lang.SecurityException: class "com.myPackage. test.client. TaskApplet" does not match trust level of other classes in the same package
I've recently tried to write a file parser for the .x3d file type as it's one of the few 3d model types I can find written in easy to understand (and interpret) English. While it technically does work (or what I have so far), the issue is that it takes far too long (17 minutes) to parse just a part of the file (the vertices of the model).This is the code for the object itself:
import java.io.*; import com.sun.j3d.utils.geometry.*; import javax.media.j3d.*; import javax.vecmath.*; public class ModelLoader { BranchGroup object = new BranchGroup(); BufferedReader reader; String line = "start";
[code]....
Anyway, here are some observations I've made about the file:
-The line in the file itself that contains all the vertices is all one giant string according to the file. -There are apparently 18,000 vertices in all (according to the command at line 18). -Unless Netbeans automatically terminates infinite loops after a certain amount of time, it is most definitely NOT an infinite loop as I have seen the program terminate on its own (after 17 minutes, though).
I had a theory that maybe organizing each vertex into its own line and then having the program switch to the next line when it's done reading that vertex might make the program run faster, but I'm not sure why it would, so I thought I'd come here in case that theory turned out to be a dead end.
I'm currently taking a computer science class but the class is moving extremely slow and I'm not learning much, so I've started to program on my own. The most recent project I've done is a tic tac toe game, and I'm looking for something else to do now. I can do with an increased difficulty from this project, but not extremely difficult.
I have a large scale enterprise application (5 modules) project using RAD, WAS v7, Java EE 6 (EJB 3.1, JPA), ZK framework.
The project is using RAD as IDE. The problem is that it takes too long to deploy (more than 5 min) when changes are made to the EJB's (although the changes are minor in only one file) but when changes are made to zk framework (the web & presentation layer), it is fast to deploy.
Don't know what cause the problem. Is it because of EJB 3.1/ JPA or RAD/ WAS?
Is it happening in other IDE or applcation server also?
I have a code below that is reading large image size and writing them to file however the process is too slow. how can i refine this code in such a way that it will work faster?
I have a code below that is reading large image size and writing them to file however the process is too slow. how can i refine this code in such a way that it will work faster?
I am working on a Java Streaming Networking ( Client Serve ) project , among remote client can:
1 ) chat,
2 ) Share files,
3 ) Share Screen live streaming,
4 ) Access the remote system.
All are working well faster & live on networking. But if i host on the Hosting server the all process are working but in deadly slow streaming is not live..,
I have been using JavaFX for some time now and have encountered many performance issues, mainly with the initial display of GUI elements. For example, a simple stage with a table view (with about 10 columns) and chart takes about 5 seconds to display. A color picker will take about 3 seconds from the time I click the control to when it displays the pallet. This only happens when the controls are first displayed. This can't be right. I have searched and none seems to have a similar problem so I thought I would ask here just to make sure. Here is a sample Hello world that shows the problem with the color picker (takes ~ 3 seconds to show pallet when clicked).
public class HelloWorld extends Application { @Override public void start(Stage primaryStage) { StackPane root = new StackPane(); ColorPicker cp = new ColorPicker(); root.getChildren().add(cp);
Visual effects such as Transitions perform very poor on linux "wheezy" compared to windows. I noticed this on different PC's, checked for Java7 and Java8. If the UI contains many objects then the transition sometimes does not even appear.
I do not think this is graphic card related since videos play quite ok.
I use the default ATI driver without Xorg.conf file and installed the xcompmgr
and tried several options, such as
Option "Composite" "Enable" or Option "backingstore" "true" Option "AllowGLXWithComposite" "true"
This did not speed up things, are there other things that I could do to improve the performance ?
I'm trying to write a transparent proxy like polipo. Polipo is written in C and I want to have the same result in java.
A simple program that can filter/monitor all connections created and closed by the browser.
To do so, I've chosen to work with sockets, because that's the only way i know to read and write raw data to and from the browser in a completely transparent way.
In this moment my code reads and writes every couple of request/response but I've noticed profiling it that the time needed to create the socket is a bottleneck.
Using URLConnection to create the same connection I need much less time than sockets.
When socket creation implies 50ms URLConnection implies only 1ms.
I usually code in PHP, C++ and ActionScript.I'm trying to follow an example of how to add images to a full screen application. What he does is that he adds a JPG background image, and then 4 PNG images. I tried to do it like I always do, by writing the code by myself looking at the book. It didn't work. I searched for errors in the code, changed some things, tried different things, but it didn't work. Then I tried to use his own code, that I downloaded from his website. That didn't work either.. I tried to find another way to add an image, and I can't seem to figure out a way to implement images in any other way into this class that's written in this book.. My Java programming level isn't just high enough.
Here's the code for the file where the images load, downloaded from the authors website (I've modified the brackets and some spaces so that it becomes easier to read):
Java Code:
import java.awt.*; import javax.swing.ImageIcon; import javax.swing.JFrame; public class ImageTest extends JFrame { public static void main(String[] args) { DisplayMode displayMode;
how I can change my code so that somebody can actually input the specified file path, rather than having it fixed in the code. I previously used
Scanner in = new Scanner(System.in); System.out.println("What is the filename?"); String input = in.nextLine(); File file = new File(input);
But then the program would not display the frequencies.
import java.io.File; import java.util.*; /* This program will allow the user to enter in a text file name, when prompted the program will anaylser the text and display the frequencies */ public class AssP { public static void main(String[] args ) { Scanner scan; try { Scanner scanner = scan = new Scanner(new File("C:/Users/Mary/workspace/Assingment/src/test.txt"));
[code]....
This is my current code and I need to so the user can load their own files.
I have added the image in the src and bin directories and cross-checked that the name of the image file is correct..Here is the main class
import javax.swing.*; public class apples { public static void main(String args[]) { JFrame frame = new JFrame(); MyDrawPanel wid = new MyDrawPanel(); frame.add(wid); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); frame.setSize(300,300); } }
and here is the class that does the image adding part
import java.awt.*; import javax.swing.*;
public class MyDrawPanel extends JPanel { public void paintComponent(Graphics g) {
Image image = new ImageIcon("b.png").getImage(); g.drawImage(image,20, 20, this); } }
So I would like to get information out of a web-API. But my question is how I do this. I guess I need to read the URL first. And parse it after but what is the best way?
How load dynamically load jars? Is it possible to load updated jar in my application by code? My application has to use new and modified class files but application should not be restarted.
I have an assignment where I need to add an interface to an already-created program. I have an array of objects, where each object has a name, price, and priority.
In my original program (which worked), I had all of the objects in 1 class. The professor said that I should split up the name/price/priority into 3 different classes. So what I have is an array that belongs to an interface, and name/price/priority implements. But I am having trouble loading the data into the array (from another class) once I am done with loading name.
Here is what I have so far.
public class Main { public static void main (String[] args){ Interface[] arr = new Interface[7]; Scanner keyboard = new Scanner(System.in); System.out.println
[code]....
Line 18 in the ItemName class is giving me an error, and I know it is because arr is of type Interface, and I am trying to assign is a String. But I don't know how to do this. In my original program I was able to do arr[x].getName(); but when I do that in Main, I get errors.
how to assign to an interface array from multiple classes.
At startup, the class containing your main method is loaded. It loads all classes that it needs. Each of those loaded classes loads the classes that it needs, and so on. That can take a long time for a big application, frustrating the user. You can give users of your program the illusion of a faster start with the following trick. Make sure that the class containing the main method does not explicitly refer to other classes. In it, display a splash screen. Then manually force the loading of other classes by calling Class.forName.
I'm not sure if I got this right - the tip amounts to suggesting to load all the classes altogether in the main method while displaying the splash screen?
Second, how can the main method not refer explicitly to other classes? It has to create some objects after all...
It loads and draws fine when I am using one image. But if I un-comment the others are try to draw the background of my game as intended, nothing gets drawn. I've played around with a number of different solutions but nothing works, I've had multiple images work in previous programs doing exactly the same thing and I really don't understand whats up.
Everything is working fine but in my case One customer has Many orders but when i do customer.getOrders() the child objects are not loading . I dont know why.am i missing something here im using MYSQL database
I am trying to make a program where a user can enter guests name for a hotel, the JTable includes rows for the name of the tenant, the room number, month etc.
I've made the table, however I am having some trouble in saving the data that I put into the table. I used jtextfield and a jbutton to but data into the jtable. I am trying to save the data, and load it just buy clicking a button.
table.setModel(new DefaultTableModel( new Object[][] { }, new String[] { "Room", "Name", "Month", "Payment"//table rows } ));
This is my basic table. And what I'm trying to do to save the data is:
DefaultTableModel model = new DefaultTableModel(); private JFileChooser myJFileChooser = new JFileChooser(new File(".")); private void saveTable() { if (myJFileChooser.showSaveDialog(null) == JFileChooser.APPROVE_OPTION ) { saveTable(myJFileChooser.getSelectedFile());
[Code] ....
When I run my program, I'm able to click on a button, and the dialog box will appear, I'm also able to save the data to a file. However when I click on the retieve data button I made the dialog box opens, the file is there, however when I click it, nothing happens.