ciao!
vorrei sapere cosa identifica questo errore:
Exception in thread "main" java.lang.NoClassDefFoundError: nome_appl.
Grazie
pgm
ciao!
vorrei sapere cosa identifica questo errore:
Exception in thread "main" java.lang.NoClassDefFoundError: nome_appl.
Grazie
pgm
il nome del file č diverso da quello della classe oppure nella classe manca il main :adhone:
grazie flotd per il consiglio, ma ho provato e tutto č in ordine, il main c'č e il nome della classe č uguale al nome del file
pgm
posta il codice della classe
Questo č il codice. Scusami in anticipo se ci sono madornali errori...Considera che č da una settimana che programmo in java.
Il programma deve prendere il valore di un campo in input, formattarlo ed inserirlo in uno stringone, il tutto verrā passato a cobol (aimč). Questo programma č una prova, infatti voglio scrivere lo stringone su un file per vedere cosa ne esce.
Ciao pgm
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.io.*;
public class pgm extends JFrame{
public static int WIDTH = 350;
public static int HEIGHT = 230;
public static String TITLE = "pgm";
Container frameContainer;
JMenuBar barraMenu = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JMenuItem fileExit = new JMenuItem("Esci");
JTextField testo = new JTextField();
JTextField testo1 = new JTextField();
JTextField testo2 = new JTextField();
JButton opButton = new JButton("Go");
public pgm() {
super(TITLE);
buildGUI();
setSize(WIDTH,HEIGHT);
setupEventHandlers();
show();
}
void buildGUI(){
setupMenuBar();
layoutComponents();
}
void setupMenuBar(){
fileMenu.add(fileExit);
barraMenu.add(fileMenu);
setJMenuBar(barraMenu);
}
public void layoutComponents(){
frameContainer = getContentPane();
frameContainer.setLayout(null);
testo.setBounds(10,10,120,18);
testo1.setBounds(10,32,120,18);
testo2.setBounds(10,54,120,18);
opButton.setBounds(10,100,50,20);
frameContainer.add(testo);
frameContainer.add(testo1);
frameContainer.add(testo2);
frameContainer.add(opButton);
}
void setupEventHandlers() {
addWindowListener(new WindowHandler());
opButton.addActionListener(new ButtonHandler());
fileExit.addActionListener(new MenuItemHandler());
}
class ButtonHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
String s = e.getActionCommand();
if(s.equals("Go")){
stampaStringa();
}
}
}
class MenuItemHandler implements ActionListener{
public void actionPerformed(ActionEvent d){
String t = d.getActionCommand();
if(t.equals("Esci")){
System.exit(0);
}
}
}
public void stampaStringa(){
String tutto = testo.getText().toUpperCase().trim(); // as 30
try{
transfert(tutto);
}catch(Exception e){
//System.out.println(e.toString());
}
}
public StringBuffer transfert(String tutto) throws IOException {
StringBuffer RWLXLB = new StringBuffer();
StringBuffer w = new StringBuffer(tutto);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,10,0);
base(RWLXLB,4,0);
base(RWLXLB,16,1);
base(RWLXLB,16,1);
base(RWLXLB,3,0);
base(RWLXLB,5,1);
base(RWLXLB,4,0);
base(RWLXLB,4,0);
base(RWLXLB,3,0);
base(RWLXLB,70,0);
base(RWLXLB,8,0);
base(RWLXLB,8,0);
base(RWLXLB,30,0);
base(RWLXLB,5,1);
base(RWLXLB,1,0);
base(RWLXLB,1,0);
base(RWLXLB,120,0);
base(RWLXLB,3,0);
base(RWLXLB,3,0);
base(RWLXLB,30,0);
base(RWLXLB,30,0);
base(RWLXLB,1,0);
base(RWLXLB,2,0);
base(RWLXLB,10,1);
base(RWLXLB,136,0);
base(RWLXLB,30,0);
base(RWLXLB,4,0);
base(RWLXLB,2,1);
base(RWLXLB,6,0);
base(RWLXLB,8,0);
base(RWLXLB,30,0);
base(RWLXLB,32,0);
RWLXLB.append("TRA");
base(RWLXLB, 3,0);
base(RWLXLB, 3,0);
base(RWLXLB, 33,0);
RWLXLB.append("DTU");
base(RWLXLB, 3,0);
base(RWLXLB, 44,0);
RWLXLB.append("O");
RWLXLB.append("S");
base(RWLXLB, 48,0);
RWLXLB.append("999");
RWLXLB.append(w); //campo di testo
int ln = w.length();
for (int i=ln; i<=30; i++)
RWLXLB.append(" ");
base(RWLXLB, 18,1);
base(RWLXLB, 69,0);
base(RWLXLB, 1,0);
base(RWLXLB, 99,0);
base(RWLXLB, 3,0);
base(RWLXLB, 30,0);
base(RWLXLB, 9,1);
base(RWLXLB, 9,0);
base(RWLXLB,50,0);
base(RWLXLB,1,0);
base(RWLXLB,3,1);
base(RWLXLB,5,1);
base(RWLXLB,3,1);
base(RWLXLB,50,0);
base(RWLXLB,30,0);
base(RWLXLB,18,1);
base(RWLXLB,3,1);
base(RWLXLB,5,1);
base(RWLXLB,1,0);
base(RWLXLB,3,0);
base(RWLXLB,5,0);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,10,0);
base(RWLXLB,4,0);
base(RWLXLB,16,0);
base(RWLXLB,16,0);
base(RWLXLB,16,0);
base(RWLXLB,1,0);
base(RWLXLB,53,0);
base(RWLXLB,3,0);
base(RWLXLB,30,0);
base(RWLXLB,9,1);
base(RWLXLB,50,0);
base(RWLXLB,50,0);
base(RWLXLB,1,0);
base(RWLXLB,3,1);
base(RWLXLB,5,1);
base(RWLXLB,3,1);
base(RWLXLB,50,0);
base(RWLXLB,30,0);
base(RWLXLB,18,0);
base(RWLXLB,3,1);
base(RWLXLB,5,1);
base(RWLXLB,1,0);
base(RWLXLB,3,0);
base(RWLXLB,5,0);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,5,1);
base(RWLXLB,10,0);
base(RWLXLB,4,0);
base(RWLXLB,16,0);
base(RWLXLB,16,0);
base(RWLXLB,16,0);
base(RWLXLB,1,0);
base(RWLXLB,53,0);
base(RWLXLB,200,0);
FileOutputStream outStream = new FileOutputStream("prova.txt");
for(int i=0; i<RWLXLB.length(); ++i)
outStream.write(RWLXLB.charAt(i));
outStream.close();
StringBuffer s = new StringBuffer(RWLXLB.toString());
return s;
}
public void base(StringBuffer arealnk, int times, int tp){
for( int i=0; i < times; ++i)
arealnk.append(" ");
}
public static void main(String[] args) {
pgm app = new pgm();
}
public class WindowHandler extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.exit(0);
}
}
}
pare a posto
questo deve stare in un file pgm.java che compili con javac pgm.java e apri con java pgm
La compilazione di pgm.java va a buon fine, ma l'esecuzione (java pgm)
mi da l'errore che ho riportato.
Non so cosa fare...fra poco spacco il computer compreso il manuale di java (scherzo). se mi dai qualche idea ti offro 7 birre dovunque tu sia.
grazie per la disponibilitā.
pgm
l'ho compilato, col jdk 1.4 e win2000 funziona
prova a dare il percorso completo del compilatore es
c:\> c:\jdk1.4\bin\java pgm
Vuoi dire cosė:
set path=%path%C:\jdk1.2.2\bin?
pgm
dal prompt dos devi scrivere quello che ho postato