Olá estou com um problemas, fiz dois projetos de XLET em java e os chamo no ncl, somente um funcioná(a classe Legenda) o outro que é idêntico não funciona (Loteria), gostaria de saber onde está o erro.
CLASSE LOTERIA---- ESSA NÃO FUNCIONA
package bin.xlet.ncl;
public class Loteria implements Xlet{
XletContext thisContext;
public void initXlet(XletContext ctx) throws XletStateChangeException {
thisContext = ctx;
}
public void startXlet() throws XletStateChangeException {
Container rootContainer = TVContainer.getRootContainer(thisContext);
Component legenda = new Component (){
public void paint(Graphics g){
g.fillRect(0, 0, 1024, 40);
g.setColor(Color.WHITE);
g.drawString("Classe Loteria", 0, 15);
}
};
JButton botao = new JButton("Mega Sena 2");
JButton botao2 = new JButton("Loteca 2");
rootContainer.setLayout(new BorderLayout());
rootContainer.setBackground(Color.BLACK);
rootContainer.add(legenda, BorderLayout.CENTER);
rootContainer.add(botao, BorderLayout.NORTH);
rootContainer.add(botao2, BorderLayout.SOUTH);
}
public void pauseXlet() {}
public void destroyXlet(boolean unconditional) throws XletStateChangeException {}
}
CLASSE LEGENDA ---- ESSA FUNCIONA CORRETO
package ncl.xlet.examples;
public class LegendaXlet implements Xlet{
XletContext thisContext;
public void initXlet(XletContext ctx) throws XletStateChangeException {
thisContext = ctx;
}
public void startXlet() throws XletStateChangeException {
Container rootContainer = TVContainer.getRootContainer(thisContext);
Component legenda = new Component (){
public void paint(Graphics g){
g.fillRect(0, 0, 1024, 40);
g.setColor(Color.WHITE);
g.drawString("Classe LegendaXlet", 0, 15);
}
};
JButton botao = new JButton("Mega Sena");
JButton botao2 = new JButton("Loteca");
rootContainer.setLayout(new BorderLayout());
rootContainer.setBackground(Color.BLACK);
rootContainer.add(legenda, BorderLayout.CENTER);
rootContainer.add(botao, BorderLayout.NORTH);
rootContainer.add(botao2, BorderLayout.SOUTH);
}
public void pauseXlet() {}
public void destroyXlet(boolean unconditional) throws XletStateChangeException {}
}
NCL
<?xml version="1.0" encoding="ISO-8859-1"?>
<ncl id="cef" xmlns="http://www.ncl.org.br/NCL3.0/EDTVProfile">
33 comentários