Code Monkey home page Code Monkey logo

javamysql03_infox's Introduction

javamysql03_infox's People

Contributors

wfrsilva avatar

Stargazers

 avatar

Watchers

 avatar  avatar

javamysql03_infox's Issues

Classe Icone - Refatorar metodo createImageIcon

Criado classe Icone.java com duas assinaturas do método createImageIcon(...) .
Refatorar todos icones:

  • TelaPrincipal

  • TelaUsuario
    • createImageIcon(..)

  • TelaCiente
    • createImageIcon(..)

  • TelaOS

setIcon(new javax.swing.ImageIcon(getClass().getResource java.lang.NullPointerException

lblStatus.setIcon(new javax.swing.ImageIcon( "Z:\\java\\javaMySQL03_infoX\\src\\main\\java\\br\\com\\infox\\icones\\dbok.png"));

Is OK!

But this:

lblStatus.setIcon(new javax.swing.ImageIcon( getClass().getResource("/br/com/infox/icones/dbok.png")));

make ERROR:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at java.desktop/javax.swing.ImageIcon.<init>(ImageIcon.java:217)
	at br.com.infox.telas.TelaLogin.<init>(TelaLogin.java:20)
	at br.com.infox.telas.TelaLogin$1.run(TelaLogin.java:124)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:389)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)

My project is running with Maven

In https://stackoverflow.com/questions/14593766/getclass-getresource-exception
I used this tip :
System.out.println(getClass().getProtectionDomain().getCodeSource().getLocation());
And the print was:
file:/Z:/java/javaMySQL03_infoX/target/classes/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.