Search Results

Search found 1033 results on 42 pages for 'nm applet'.

Page 4/42 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to fix the position of the button in applet

    - by user1609804
    I'm trying to make an applet that has a buttons in the right, where each button is corresponding to a certain pokemon. I already did it, but the buttons isn't fixed.they keep following the mouse. please help. This is my code: import javax.swing.*; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; import java.applet.*; import java.awt.event.*; import java.awt.*; public class choosePokemon extends Applet implements ActionListener { private int countPokemon; private int[] storePokemon; private int x,y; //this will be the x and y coordinate of the button BufferedImage Picture; public int getCountPokemon(){ //for other class that needs how many pokemon return countPokemon; } public int[] getStoredPokemon(){ //for other class that needs the pokemon return storePokemon; } public void init(){ x=0;y=0; try{ Picture = ImageIO.read(new File("pokeball.png")); } catch( IOException ex ){ } } public void paint( Graphics g ){ pokemon display = new pokemon(); // to access the pokemon attributes in class pokemon ButtonGroup group = new ButtonGroup(); //create a button group for( int a=0;a<16;a++ ){ // for loop in displaying the buttons of every pokemon(one pokemon, one button) display.choose( a ); //calls the method choose in which accepts an integer from 0-15 and saves the attributes of the pokemon corresponding to the integer JButton pokemonButton = new JButton( display.getName() ); // creates the button pokemonButton.setActionCommand( display.getName() ); // isasave sa actioncommand yung name ng kung ano mang pokemon pokemonButton.addActionListener(this); //isasama yung bagong gawang button sa listener para malaman kung na-click yung button pokemonButton.setBounds( x,y,50,23 ); group.add( pokemonButton ); //eto naman yung mag-aadd sa bagong gawang button sa isang group na puro buttons(button ng mga pokemon) y+=23; if( a==7 ){ x+=50; y=0; } add( pokemonButton ); //will add the button to the applet } g.drawImage( Picture, 120, 20, null ); } public void actionPerformed(ActionEvent e) { try{ //displays the picture of the selected pokemon Picture = ImageIO.read(new File( "pokemon/" + e.getActionCommand() + ".png" )); } catch( IOException ex ){ } } public boolean chosen( int PChoice ){ //this will check if the chosen pokemon is already the player's pokemon boolean flag = false; for( int x=0; x<countPokemon && !flag ;x++ ){ if( storePokemon[x]==PChoice ){ flag = true; } } return flag; }

    Read the article

  • Applet networking patterns

    - by Kristoffersen
    Hi SO. I have an applet that connects to a server, it receives some commands and based on that it haves to draw (or move) different things. Which patterns should I use? I assume that the network connection and applet should run in two different threads? Thanks, Kristoffer

    Read the article

  • Java Applet Buffering images

    - by Dan
    OK so here's my code: http://www.so.pastebin.com/Qca4ERmy I am trying to use buffers so the applet won't flicker upon redraw() but it seems I am having trouble. The applet still flickers.... Help? Thank you.

    Read the article

  • Java Applet flickers on redraw();

    - by Dan
    OK so here's my code: http://www.so.pastebin.com/08ghTkQL When I press UP, DOWN, LEFT, or RIGHT... the applet redraws itself and positions the new player... sometimes when I do this (pressing buttons), the whole java applet flickers.... how do I stop this? Thank you.

    Read the article

  • Why can't untrusted code change the log level under Java Logging?

    - by cdmckay
    I'm have a Java app that also runs as an applet. The app also happens to use a library called BasicPlayer to play .ogg files. BasicPlayer has a built-in logger that uses Apache Logging Commons to create a logger for BasicPlayer.class using the built-in Java logger. The only way that I know about to turn off the BasicPlayer logging is to run this code: Logger.getLogger(BasicPlayer.class.getName()).setLevel(Level.OFF); This works fine when running as a regular app. However, when running as an applet, this code will throw a SecurityException because for some reason applets can't change the log level of non-anonymous loggers (see here for a sorta-explanation). Why would they do this? Who cares if an applet changes the log level?

    Read the article

  • How to Prevent an Applet from Unloading across web pages?

    - by Francis Shanahan
    I have a large applet that takes some 40 seconds to initialize (cabs are cached so ignore download time for this question). The issue is, if the user goes to Page A which launches the applet (single window) and then navigates to page B, the applet is unloaded. If the user goes back to Page A, they incur the 40 seconds init time once again. I'd like to be able to launch the applet, incurring the 40 seconds init time once and only once. The applet needs to reside inside a single browser window (the same window as my web application). In other words, I cannot launch the applet in a popup. Does anyone have any creative ideas around how to prevent the applet unloading?

    Read the article

  • A peculiar issue with nm-applet

    - by montreux
    There is a somewhat strange error that I've noticed with my gnome sessions. It's not a problem that causes a lot of trouble, but at times it becomes annoying. Anyway, here it is: when I fire up gnome-session-fallback (which is the main one I use), the network applet doesn't run with root permission. Here is what it looks like http://i.imgur.com/8kc7Vrd.jpg . On the other hand, here is what the regular gnome session looks like http://i.imgur.com/wfkkE3E.jpg . From the regular session I can easy edit and add networks, but from fallback session I cannot add/edit anything, or turn off/on the wireless or networking. Any ideas?

    Read the article

  • how to display a JFrame from an applet?

    - by mithun1538
    Hello everyone, I have this class called PollFrame that extends JFrame in a file called PollFrame.java . PollFrame contains a form. I have an applet, which has a button in it. When the button is clicked, I want the PollFrame to be displayed. I set the ActionPerformed as: Pollframe poll = new PollFrame(); // This initializes the form poll.setVisible(true); However, when I click the button, I get the following error : Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM.0) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkExit(Unknown Source) at javax.swing.JFrame.setDefaultCloseOperation(Unknown Source) at com.org.pollFrame.initComponents(pollFrame.java:54) at com.org.pollFrame.<init>(pollFrame.java:11) at com.org.EmployeeApplet.requestRoomActionPerformed(EmployeeApplet.java:216) at com.org.EmployeeApplet.access$300(EmployeeApplet.java:7) at com.org.EmployeeApplet$4.actionPerformed(EmployeeApplet.java:71) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) I am guessing fromt he above error that calling another class file from an applet is prohibited. Is there any way I can display the PollFrame from the applet?

    Read the article

  • How to move image in Applet?

    - by user1609804
    I want to move the character left, right up, and down in applet, but it is not moving at all. here is my code, help please import javax.swing.JPanel; import java.awt.image.BufferedImage; import java.io.*; import javax.imageio.ImageIO; import java.applet.*; import java.awt.event.*; import java.awt.*; public class drawCenter extends Applet { private int x,y;// the x and y of the position of the player private BufferedImage image, pos; public void init( ) { try { image = ImageIO.read(new File("pokemonCenter.png")); pos = ImageIO.read(new File("player/maleInGame.png")); } catch (IOException ex) { } x = 150; y = 171; } public void keyPressed(KeyEvent e) { int keyCode = e.getKeyCode(); switch( keyCode ) { case KeyEvent.VK_UP: if( y>0 ) { y=y-19; repaint(); } break; case KeyEvent.VK_DOWN: if( y<171 ) { y=y+19; repaint(); } break; case KeyEvent.VK_LEFT:if( x>0 ) { x=x-15; repaint(); } break; case KeyEvent.VK_RIGHT:if( x<285 ) { x=x+15; repaint(); } break; } e.consume(); } public void keyReleased(){ } public void paint( Graphics g ) { g.drawImage(image, 0, 0, null); g.drawImage(pos, x, y, null); } }

    Read the article

  • How to securely communicate with a database using a java applet

    - by WarmWaffles
    I have been writing web applications for quite sometime in PHP with MySQL. I always stored my database connection information into a configuration variable and connected to the database that way. A client wants a java applet for their website to communicate with their database. I'm very hesitant on this because the applet is going to be public and I am not sure how I would go about storing the database connection information. I'm paranoid that someone would decompile my application or find some way to extract my database connection information and use it maliciously. Any suggestions on how to do this securely?

    Read the article

  • applet communication using post method

    - by mithun1538
    I have an applet that is communicating with a servlet. I am communicating with the servlet using POST method. My problem is how do I send parameters to the servlet. Using GET method, this is fairly simple ( I just append the parameters to the URL after a ?). But using POST method how do I send the parameters, so that in the servlet side, I can use the statement : message = req.getParameter("msg"); In the applet side, I establish POST method connection as follows : URL url = new URL(getCodeBase(), "servlet"); URLConnection con = url.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); con.setRequestProperty("Content-Type","application/octet-stream");

    Read the article

  • RMI applet is making requests on random ports and blocked consequently

    - by Dan
    /// I have set up RMI system successfully on local ubuntu srver. Registry port 1099 and remote object export on 1100(fixed by calling super(1100)) Now I am trying to make it work on Ubuntu over internet with a public IP. I could bind service properly with public ip.But the client applet is trying to connect to ubuntu server at random ports. Below is the error thrown by client applet: // Exception network: Connecting public-ip:1100 with proxy=DIRECT network: Connecting public-ip/cgi-bin/java-rmi.cgi?forward=1099 with proxy=DIRECT network: Connecting public-ip:3733 with proxy=DIRECT network: Connecting public-ip:3721 with proxy=DIRECT // java.rmi.ConnectException: Connection refused to host: public-ip; nested exception is: java.net.ConnectException: Connection refused: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)Source) at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ... // // I have only 2 ports open on server, i.e., 1099(registry) and 1100(export). How can I fix ports in applet requests such that it does always connect server on same open port? // // Another issue.As I have bound service on public IP i.e. //public-ip:1099/ServiceName, a job running on server to send message to clinets is not able to make request to RMI service. public-ip URL does not work on same machine,i.e., server.Do you think I should use fixed socket factory?If so please give me code snippet and guide me how i can set it up. //Exception java.rmi.ConnectException: Connection refused to host: public-ip; nested exception is: java.net.ConnectException: Connection refused at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:619) at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216) at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202) at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:128) at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194) at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148) at $Proxy5.getUserID(Unknown Source) at rmi.source.xxxxxx$JobScheduler.run(xxxxServerImpl.java:293) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:337) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:180) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at java.net.Socket.(Socket.java:425) at java.net.Socket.(Socket.java:208) at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40) at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:146) at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613) ... 9 more Coould you please help me? Thanks a lot in advance. Dan

    Read the article

  • Java applet icon doesn't show

    - by user295744
    I have a java applet where I've changed the image icon that appears in the top left corner of the window. The code I use is this: Toolkit kit = Toolkit.getDefaultToolkit(); Image frameIcon = kit.getImage("src/myapp/resources/logo.png"); getFrame().setIconImage(frameIcon); Everything works fine until I deploy the applet to a standalone jar. In this case the icon that shows is the default icon, as if the code couldn't find the image. But the image is inside, although it is in the folder: myapp/resources/ What am I doing wrong here? Is this some weird java bug?

    Read the article

  • Error whenever a java applet is loaded

    - by Mudtail
    Hi. For the past few months or so, I've been getting an error whenever I attempt to use a java applet. I'm getting this error on every browser I use, and I get the error occasionally in linux, too. The java applet loads for roughly 5 seconds or so, then it stops and I get two error messages, stating that an exception occurred (java.io.EOFException). This seems to happen regardless of what website I'm using. Going to the website shows I'm running java 6 update 20, and I get no error. Googling the error turns up nothing useful - I'm not a java developer, so most of the results don't apply to me at all. My question is this. What's causing this error, and what can I do to fix whatever issue is causing it?

    Read the article

  • Use deployJava.js to check for/automatically install latest JRE version for web applet

    - by Pryo
    I'd like to use the deployJava.js tool to have Java automatically detect the currently installed JRE and install an updated version if necessary. My initial impression when reading about deployJava.js was that it would do this out of the box when you simply set a version number as a function parameter for the "runApplet" function. But this has never seemed to work. Is it even possible to do this, and if so, how? Here is my current code for launching my applet: <script type="text/javascript" src="https://www.java.com/js/deployJava.js"></script> <script type="text/javascript"> var attributes = {id:"applet", name:"TheApplet", code:"TheApplet"}; var parameters = {jnlp_href: "http://localhost/TheApplet.jnlp"}; deployJava.runApplet(attributes, parameters, "1.6.0_31"); </script> Thanks

    Read the article

  • Can I use GNOME applets in Unity?

    - by Moma Antero
    Applets are small programs that you attach and start from the GNOME's toolbar. See picture: http://www.futuredesktop.com/audio-recorder/recorder-applet.ogv My favourite applets are: rec-applet: Smart audio recorder applet. You can get this from Launchpad. clipart-finder: Find and download clipart to your computer. You can get this from the Launchpad. 1) Can I use these applets in UNITY as is? 2) What changes I have to make to applets' code (rec-applet and clipart-finder) to make them usable in Unity? 3) Where is the applet-specification for Unity?

    Read the article

  • Can I use GNOME-applets in Unity?

    - by Moma Antero
    Hello, Applets are small programs that you attach and start from the GNOME's toolbar. See picture: http://www.futuredesktop.com/audio-recorder/recorder-applet.ogv My favourite applets are: rec-applet: Smart audio recorder applet. You can get this from Launchpad. clipart-finder: Find and download clipart to your computer. You can get this from the Launchpad. 1) Can I use these applets in UNITY as is? 2) What changes I have to make to applets' code (rec-applet and clipart-finder) to make them usable in Unity? 3) Where is the applet-specification for Unity?

    Read the article

  • Network Manager Applet menu freezes and does not respond

    - by pst007x
    Since the latest update in Ubuntu 10.10, the nm-applet has started doing some strange things. I boot up the PC, all is fine, internet works, etc... but after a period of time, approx and hour, the nm-applet menu in the Gnome panel fails to respond. when I click on the icon, the menu appears, all looks well, but when I select any option, eg DISCONNECT, nothing happens. Even the VPN sub menu disappears (no triangle to select the menu.) However I do not lose the network connection... If I Run this script: killall nm-applet /etc/init.d/NetworkManager restart nm-applet all returns as normal, for a while... weird? i tried uninstall/reinstall... I even reinstalled Ubuntu, but once the latest updates are applied this issues arises... Any help?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >