ragazzi!!!!
quando metto un controllo non funziona ora vi metto il cod:
codice:
while (rs.next()) {
QueryResult temp = new QueryResult(rs.getInt("id"),rs.getString("nome"), rs.getString("testo"));
String substring = rs.getString("testo").substring(rs.getString("testo").lastIndexOf('.')+1);
if (substring == "pdf") {
pagePanel.setVisible(true);
editor.setVisible(false);
textArea.setVisible(false);
System.out.println(substring);
File file = new File(temp.testo);
RandomAccessFile raf = new RandomAccessFile(file, "r");
FileChannel channel = raf.getChannel();
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
pdffile = new PDFFile(buf);
tot_pages = pdffile.getNumPages();
try {
prevB.setEnabled(false);
showPage(pg = 1);
}
catch (Exception e) {
e.printStackTrace();
}
totalTimeLabel.setText(secondToTime((int)playerCTL.getTotalTimeSecond()));
}
come mai????