File file = save.getSelectedFile();
FileOutputStream outfile = new FileOutputStream(file);
ObjectOutputStream outobj = new ObjectOutputStream(outfile);
outobj.writeObject(listProduct);
reloadList();
} catch (IOException ex) {
// TODO Auto-generated catch block
ex.printStackTrace();
}
}
}
}
Button buttonSave = new Button("Save as...");
buttonSave.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
myThread mT = new myThread();
mT.start();
mT = null;
}
});
1. Save...
2. Open…
Документация
· java.lang.Object
·
· Lab_7.GUIMainForm.myRunnable
· All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
GUIMainForm
public class GUIMainForm.myRunnable
extends java.lang.Object
implements java.lang.Runnable
·
Constructors |
Constructor and Description |
GUIMainForm.myRunnable |
Methods |
|
Modifier and Type |
Method and Description |
|
run |
equals, getClass,
hashCode, notify, notifyAll, toString, wait, wait, wait
·
public GUIMainForm.myRunnable()
public void run()
Specified by:
run
in interface java.lang.Runnable
· java.lang.Object
·
· java.lang.Thread
·
· Lab_7.GUIMainForm.myThread
· All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
GUIMainForm
public class GUIMainForm.myThread
extends java.lang.Thread
·
java.lang.Thread.State,
java.lang.Thread.UncaughtExceptionHandler
MAX_PRIORITY,
MIN_PRIORITY, NORM_PRIORITY
Constructors |
Constructor and Description |
GUIMainForm.myThread |
Methods |
|
Modifier and Type |
Method and Description |
|
run |
activeCount, checkAccess,
countStackFrames, currentThread, destroy, dumpStack, enumerate,
getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler,
getId, getName, getPriority, getStackTrace, getState, getThreadGroup,
getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon,
isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon,
setDefaultUncaughtExceptionHandler, setName, setPriority,
setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend,
toString, yield
equals, getClass,
hashCode, notify, notifyAll, wait, wait, wait
·
public GUIMainForm.myThread()
public void run()
Specified by:
run
in interface java.lang.Runnable
Overrides:
run
in class java.lang.Thread
Заключение
В ходе выполнения лабораторной работы были изучены и освоены способы построения многопотоковых приложений. Так же была освоены базовые средства и возможности синхронизации потоков.
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.