과제를 위해 작은 Java 애플릿을 만들어 웹 페이지에 표시해야했습니다. 그것은 넷빈즈에서 잘 빌드,하지만 웹 페이지에서 실행하려고 할 때 그것은 다음과 같이 회색으로 표시 그래서 Java JApplet은 웹 페이지에 회색으로 표시됩니다.
import java.awt.GridBagConstraints;
import java.lang.reflect.InvocationTargetException;
import javax.swing.JButton;
import javax.swing.JTextArea;
public class PlanZajecJavaProjektApplet extends javax.swing.JApplet {
/**
* Initializes the applet PlanZajecJavaProjektApplet
*/
public static int licznikTextFields = 0;
int dzienLekcji;
int godzinaLekcji;
int ileGodzinLekcji;
private GridBagConstraints gridBagConstraints;
private JButton button;
@Override
public void init() {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(PlanZajecJavaProjektApplet.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the applet */
try {
java.awt.EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
initComponents();
}
});
} catch (InterruptedException | InvocationTargetException ex) {
}
}
/**
* This method is called from within the init() method to initialize the
* form. WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
것은 무슨 일을 할 수 있는가?
은 .. 또한'initComponents'에 대한 코드를 표시하고 '빈 블록 catch' 떠나지 않았다. 그 안에'stacktrace' 예외를 출력하십시오. –
http://pastebin.com/Gn8btFqK Netbeans에서 생성 한 코드입니다. – Aclber
stacktrace를 인쇄했는데 이제 Java Console에 http://i.imgur.com/voOjuZJ.jpg가 표시됩니다. – Aclber