Find Jobs
Hire Freelancers

Applet Redisplay

$30-100 USD

En curso
Publicado hace alrededor de 16 años

$30-100 USD

Pagado a la entrega
Part of my web site requires the need to run an Applet that talks directly to a client device. My applet acquires an image and sends it back to the server. My applet skills are minimal and I would like to contract out development of a specific part of this applet for re-displaying the acquired image and providing the use a button to try again. ## Deliverables All I need for this bid is to see a test applet with a button that will process the actionlistener and redisplay the applet with a new image. The following test applet may be a starting point for you. I can integrate the modified test applet into my web site for testing. If the applet refreshes or redisplays a new image based on an event, then I will be able to integrate this into the real applet in my product. ========================================= package [login to view URL]; import [login to view URL]; import java.applet.*; import java.awt.*; import [login to view URL]; import [login to view URL]; import [login to view URL]; import javax.swing.*; import javax.swing.border.*; import [login to view URL]; import java.awt.event.*; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; import [login to view URL]; public class TestApplet extends JApplet implements ActionListener { private TextField nameField = null; private JButton buttonRetry = null; private JButton buttonSave = null; private JButton imageButton = null; private static String BUTTON_RETRY = "Retry"; private static String BUTTON_SAVE = "Save"; private ImageIcon imageIcon = null; private ImageButton imgButton = null; byte[] readBuf; public TestApplet() throws HeadlessException { super(); } public static void main(String[] args) { } public void destroy() { [login to view URL](); } public void init() { [login to view URL](); try { readBuf = getBytesFromFile(new File("C:\\dfvault\\[login to view URL]")); } catch (Exception e) {} //BufferedImage bufImg = new BufferedImage(readBuf); imageIcon = new ImageIcon(readBuf); imageButton = new JButton(imageIcon); [login to view URL]([login to view URL]); [login to view URL](true); [login to view URL]([login to view URL]([login to view URL])); [login to view URL]([login to view URL]); buttonRetry = new JButton( BUTTON_RETRY ); buttonSave = new JButton( BUTTON_SAVE ); nameField = new TextField("press a button",20); [login to view URL]( this ); [login to view URL]( this ); add(buttonRetry, BorderLayout.PAGE_START); //add(buttonSave, [login to view URL]); add(imageButton, [login to view URL]); add(nameField, BorderLayout.PAGE_END); setVisible(true); } public void actionPerformed( ActionEvent actionEvent ) { String actionName = [login to view URL]().trim(); if ([login to view URL]() == buttonRetry) { [login to view URL]("Retry button was pressed!"); try { readBuf = getBytesFromFile(new File("C:\\dfvault\\owner_3\\[login to view URL]")); } catch (Exception e) {} imageIcon = new ImageIcon(readBuf); imageButton = new JButton(imageIcon); [login to view URL]([login to view URL]); [login to view URL](true); [login to view URL]([login to view URL]([login to view URL])); [login to view URL]([login to view URL]); repaint(); } else if ([login to view URL]() == buttonSave) { [login to view URL]("Save button was pressed!"); repaint(); } } public void paint(Graphics g) { [login to view URL]([login to view URL](), 20, 100); } public class ImageButton extends JButton { protected void paintComponent(Graphics g) { // Paint the default look of the button. [login to view URL](g); // Your custom painting here. //[login to view URL](foregroundImage, 0, 0, this); } } public void start() { // TODO Auto-generated method stub [login to view URL](); } public void stop() { // TODO Auto-generated method stub [login to view URL](); } public byte[] getBytesFromFile(File file) throws IOException { InputStream is = new FileInputStream(file); long length = [login to view URL](); if (length > Integer.MAX_VALUE) { // File is too large return null; } byte[] bytes = new byte[(int)length]; int offset = 0; int numRead = 0; while (offset < [login to view URL] && (numRead=[login to view URL](bytes, offset, bytes.length-offset)) >= 0) { offset += numRead; } if (offset < [login to view URL]) { throw new IOException("Could not completely read file "+[login to view URL]()); } [login to view URL](); return bytes; } }
ID del proyecto: 3805504

Información sobre el proyecto

1 propuesta
Proyecto remoto
Activo hace 16 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
See private message.
$85 USD en 14 días
5,0 (1 comentario)
1,9
1,9

Sobre este cliente

Bandera de UNITED STATES
United States
5,0
1
Miembro desde mar 18, 2008

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.