Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
Las imágenes no funcionan en eclipse.

Ya busqué en youtube y aquí y probablemente sea una pregunta tonta, pero no pude encontrar cómo hacer que funcione.

La pregunta es cuando agrego imágenes en mi archivo de eclipse, se ven como;

ingrese la descripción de la imagen aquí

 setLayout(new FlowLayout()); image1 = new ImageIcon(getClass().getResource("view.jpg")); label1 = new JLabel(image1); add(label1); image2 = new ImageIcon(getClass().getResource("view1.jpg")); label1 = new JLabel(image2); add(label2); // here my code

¿Algunas ideas?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Obtuve un método de uso para configurar el ícono para la etiqueta, puede consultar

 private void loadAvartar(JLabel lbl, String path){ try { BufferedImage image = ImageIO.read(new File(path)); ImageIcon icon = new ImageIcon(image.getScaledInstance(100, 100, 50)); lbl.setIcon(icon); } catch (IOException | java.lang.NullPointerException e) { lbl.setText("Failed"); } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!