A
AkeL.php
Guest
Наверно предлагают смотреть в сторону SWT.
P.S. или AWT ))))
P.S. или AWT ))))
---TaskList.java---
....
ArrayList list = new ArrayList();
....
public void serializableTaskList(File file) throws FileNotFoundException, IOException
{
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
oos.writeObject(list);
oos.flush();
oos.close();
}
---BlaBlaBla.java---
...
ArrayList taskList = new TaskList();
...
private JButton getSerializeTaskListButton(){
if (serializeTaskListButton == null) {
serializeTaskListButton = new JButton("Serialize");
serializeTaskListButton.setBounds(new Rectangle(200, 185, 90, 29));
serializeTaskListButton.setToolTipText("<html> Click a button to delete <br> task from program</html>");
}
serializeTaskListButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae){
jfc.setFileFilter(resFileFilter);
if(taskList!=null && taskList.getSize()>0){
int res = jfc.showSaveDialog(null);
if(res==JFileChooser.APPROVE_OPTION)
try{ System.out.println(jfc.getSelectedFile().getAbsolutePath());
taskList.serializableTaskList(jfc.getSelectedFile()) ;
//JOptionPane.showMessageDialog(null, "Successfully serialized.","Serialization OK",JOptionPane.INFORMATION_MESSAGE);
}
catch (FileNotFoundException fe){
JOptionPane.showMessageDialog(null,
"Serialization error! Maybe can't write file.",
"Error",
JOptionPane.ERROR_MESSAGE);
}
catch(IOException ie){
JOptionPane.showMessageDialog(null,
"Serialization error! Error while writing file.",
"Error",
JOptionPane.ERROR_MESSAGE);
}
}
else
JOptionPane.showMessageDialog(null,
"TaskList is empty",
"Empty TaskList",
JOptionPane.ERROR_MESSAGE);
}
});
return serializeTaskListButton;
}
FTPClient.java:124: warning: [deprecation] readLine() in java.io.DataInputStream has been deprecated
while ((str2 = localDataInputStream.readLine()) != null)
^
FTPClient.java:131: warning: [empty] empty statement after if
if (localSocket == null);
^
FTPClient.java:240: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector
dvl.add(line);
я яву вижу очень оченбь редко, но чтото мне подсказывает что еше неплохо видить код, а если по ошибкам то:Подскажите, что это за варнинги и как с ними бороться.
Код:FTPClient.java:124: warning: [deprecation] readLine() in java.io.DataInputStream has been deprecated while ((str2 = localDataInputStream.readLine()) != null) ^ FTPClient.java:131: warning: [empty] empty statement after if if (localSocket == null); ^ FTPClient.java:240: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.Vector dvl.add(line);
BufferedReader d = new BufferedReader(new InputStreamReader(in));
if (localSocket == null)
try {
localSocket.close(); } catch (IOException localIOException4) {
}