Java Coding Standard

Size: px
Start display at page:

Download "Java Coding Standard"

Transcription

1 <JSTORM> Revision <1.0> ÿ JSTORM

2 Revision: <1.0> < > Document Information Document title: Document file name: ( ÿ, 1.0,draft).doc Revision number: <1.0> Issued by: < ÿ > (mailto: dogjdw@nownuri.net) Issue Date: < > Status: Draft Audience Abstract Reference Benchmark information Content Information Í ì æ ì ûý. JSTORM <274>

3 Revision: <1.0> < > Document Approvals Signature date Signature date * approval. Revision History * þ Revision Date Author Description of change JSTORM <374>

4 Revision: <1.0> < > Table of Contents 1. Ð ë JSTORM <474>

5 Revision: <1.0> < > :7 Ð Í Ð ý. æ ý. Ì Í Ð Í Í ý. Í æ (Architecture) ý. ç Ð ý. ý ý. Ìé Ì Ì ý. ì Ð Ð ý. (?) ý. ì ý. Ì ì ( ý) (javax.swing.table) ý. Í ý. ý æ û Ì ì ý. æ ý. Í æ ç û Ì æ ý Ð ý. Ð Ð Ì Ì Ì Ì ý. ý ( ). Ì Ð ý.? (Sorting) Ð ý. ý. Í Ð $100,000 ý. Ì ý ý. Ì ý. ÿ ý Ð Í ý. Í Í ûý. ÿ ÿ Í ý. ( Ð ý) ÿ ý Ð ì ì û MVC(Model View Controller) ÿ ý JSTORM <574>

6 Java Coding Standard Revision: <1.0> < > Ð Ð ý. Ì ÿ. 1. Ð (1) Ð Ì ý. ü ý ý. Ì õ. 1) [ 1] Ì 2 ý. (Row ) (Record) (Column ) (Field) þ ý. Ì (Cell) ý. þ ý. ý æ ý. [ 1] ý 2) ý. [Ì 1] æ ý. ý. Ì Í ÿ ( ý.) û ý. ý [Ì 1] ÿ æ ý. [Ì 1]. ý Ð ý. [Ì 1] ( ) JSTORM <674>

7 Revision: <1.0> < > TableModel, AbstractTableModel, DefaultTableModel. (Model) ý. ÿ Í ý. [ 1] ý. [ 1] TableModel ÿ Í ý. TableModel Ð ý. AbstractTableModel þ ý. AbstractTableModel JTable ý. DefaultTableModel AbstractTableModel ý. Ì ý TableColumn, TableColumnModel, DefaultTableColumnModel. ý., Ð, ý, ý. MVC ý. ý ì Ð ý. Ð ý. JSTORM <774>

8 Revision: <1.0> < > [ 2] TableColumn JTableColumnModel DefaultTableColumnModel TableCellRenderer, TableCellEditor. ý. TableCellRenderer æ (Visual) æ TableCellEditor æ ý. ý. [ 1] (String) Í ý. (Integer) Í ý. þ(tablecolumn) TableCellRenderer TableCellEditor ý.. [ 3] TableCellRenderer TableCellEditor ÿ ý. Ð JTable JTableColumnModel Ð ý. Ð ý. Ð ý. Í ÿ ý. ÿ Í,, Ì ý. ý Ð ý Ô ý. Ð æ ÿ ý. Ì ý Ð ý. [ 1] ý public class FirstTableDemo extends JFrame { ** * private static final String[] m_columnnames = { " ", " ", " ", " " ; ** * private Object[][] m_data = { { " ", new Integer(27), " ", " ", { " ", new Integer(30), " ", " ", { " ", new Integer(24), " ", " ", { " ", new Integer(32), " ", " ", { " ", new Integer(57), " ", " ", JSTORM <874>

9 Revision: <1.0> < > { " ", new Integer(75), " ", " ", { " ", new Integer(27), " ", " " ; ** Constructor * public FirstTableDemo() { super(" "); JTable table = new JTable(m_data, m_columnnames); table.setpreferredscrollableviewportsize( new Dimension(500, 70)); JScrollPane scrollpane = new JScrollPane(table); getcontentpane().add(scrollpane, BorderLayout.CENTER); public static void main(string[] args) { FirstTableDemo frame = new FirstTableDemo(); frame.pack(); frame.setvisible(true); [ 1] [ 1] Ì Ð Ð Ì ý. ( Ð ý. ý. Ì Ð ý.) ý. þ m_columnnames þ m_data JTable ì ý. JTable table = new JTable(m_data, m_columnnames); JTable ý. ý ÿ JTable Ð ý. Ð ( ) Ð Ìÿ ý ( Ð ) ý Ì Ý ý. Ð [Ì 1] ý ý. Ð ý. TableColumnModel TableColumn (Contains) ý? JTable TableColumnModel ý ListSelectionModel JSTORM <974>

10 Revision: <1.0> < > ý? ý. Ì [ 1] Ð Ðÿ ý. 2. JTable ÿ ý(represent). Ì ÿ JTable ý ý. (Column Header) JTableHeader, TableCellRender TableCellEditor, Ì ý Ð TableColumn ý. ý TableColumnModel ý. JTable Ì ÿ ÿ (?) ý. æ þ. (1) TableModel, AbstractTableModel, DefaultTableModel TableModel JTable ý. [ 4] JDK Ð ý. [ 4] TableModel JTable ( ) (Class) ý. getcolumnclass() getcolumnclass() ý. æ ý. getcolumncount() ý. getcolumnname() Ð ý. getrowcount() ý. getvalueat() ý. iscelleditable() æý. setvalueat() ý. TableModel JTable ý. TableModel Ð AbstractTableModel ý. ý AbstractTableModel ý. AbstractTableModel ë (EventListeners) (Fire) ý. Ì ý ý. AbstractTableModel Ð ý. public int getrowcount(); public int getcolumncount(); public Object getvalueat(int rowindex, int columnindex); JSTORM <1074>

11 Revision: <1.0> < > JTable ý. MyTableModel ý JTable ì ý. TableModel mytablemodel = new MyTableModel(); JTable table = new JTable(myTableModel); JTable setmodel() ý. [ 2] ý Ð GugudanTableModel ý. Ð ý. ý ý. TableModel ý. ý ý. [ 2] public class GugudanModelDemo extends JFrame { public GugudanModelDemo() { super(" "); GugudanTableModel mymodel = new GugudanTableModel(); JTable table = new JTable(myModel);. getcontentpane().add(table.gettableheader(), BorderLayout.NORTH); getcontentpane().add(table, BorderLayout.CENTER); public static void main(string[] args) { GugudanModelDemo frame = new GugudanModelDemo(); frame.pack(); frame.setvisible(true); ** * class GugudanTableModel extends AbstractTableModel { public int getcolumncount() { return 9; public int getrowcount() { return 9; public String getcolumnname(int col) { return "" + (col+1); public Object getvalueat(int row, int col) { return new Integer((row+1)*(col+1)); JSTORM <1174>

12 Java Coding Standard Revision: <1.0> < > [ 2] ý Í Ð ý. DefaultTableModel JTable Ð ( ) ý. [ 1] ý. JTable DefaultTableModel ý. AbstractTableModel Ð æ ý. Ì ý. æ ý. DefaultTableModel Ð Ð ý. DefaultTableModel Ì æ ý. (2) TableColumnModel, DefaultColumnModel [Ì 1] JTable TableModel TableColumnModel ý. TableColumnModel ý. ý ÿ,, ý. [ 5] ý. [ 5] TableColumnModel addcolumn() TableColumnModel (TableColumn) ý. getcolumnindex() getcolumnatx() movecolumn() removecolumn() (TableColumn) ý. Ðý. TableColumnModel ý. TableColumnModel ý. â ûý. ý â ý. Ì ý ý Ì ý. Ì TableColumnModelListener ý. ColumnModelEvent ý. [ 5] æ þ addcolumnmodellistener() removecolumnmodellistener() TableColumnModel JSTORM <1274>

13 Revision: <1.0> < > ý. TableColumnModelListener ý ý. columnselectionchanged() ý ý. public void columnadded(tablecolumnmodelevent e) public void columnremoved(tablecolumnmodelevent e) public void columnmoved(tablecolumnmodelevent e) public void columnmarginchanged(changeevent e) public void columnselectionchanged(listselectionevent e) DefaultTableModel TableColumnModel DefaultTableColumnModel ý. ë(tablecolumnmodellistener) ý ý. (3) TableCellRenderer, TableCellEditor ÿ TableColumn ý. TableColumn ÿ TableColumnModel TableColumn ý. Ì ý. ý ý. Ì ÿ Ð. ÿ. æ æ ý. TableCellRenderer TableCellEditor ý. Ð(Cell Renderer) Ð(Cell Editor) ý. ý. ý ý. public Component gettablecellrenderercomponent( JTable table, Object value, boolean isselected, boolean hasfocus, int row, int column) public Component gettablecelleditorcomponent( JTable table, Object value, boolean isselected, int row, int column) ì ì ý. JTable Ð Ð ý TableCellRenderer Ð DefaultTableCellRenderer TableCellEditor Ð DefaultTableCellEditor ý. DefaultTableCellRenderer gettablecellrenderercomponent ì value JSTORM <1374>

14 Java Coding Standard Revision: <1.0> < > þ ì ý. [ 6] Ì ý. Boolean JCheckBox þ ý. [ 6] DefaultTableCellRender ì value ì Boolean JCheckBox Number JLabel ( ) ImageIcon JLabel ( ) Object JLabel (Object ) DefaultTableCellRenderer DefaultTableCellEditor ý ý Ð ý. [ 3] Ì [ 1] Ì Þ ý. Ð ý. ý ý. TableColumn job = table.getcolumnmodel().getcolumn(3);. JComboBox combojob = new JComboBox(); combojob.additem(" "); combojob.additem(" "); combojob.additem(" "); combojob.additem(" "); combojob.additem(" "); combojob.additem(" "); combojob.additem(" "); job.setcelleditor(new DefaultCellEditor(comboJob)); [ 3] Ð JSTORM <1474>

15 Java Coding Standard Revision: <1.0> < > (4 TableColumn) æ ý Ì Ð ý. Ð setcelleditor() ý. new DefaultCellEditor(comboJob) Ð æý. DefaultCellEditor ý ý. public DefaultCellEditor(JTextField x) public DefaultCellEditor(JCheckBox x) public DefaultCellEditor(JComboBox x) DefaultCellEditor ì DefaultCellEditor gettablecelleditorcomponent() ý. DrfaultCellEditor ý Ð ý Ð ý. Ì DrfaultCellEditor Ð Ð ý. TableCellRenderer TableCellEditor Ð Ð ý. [ 4] ý. [ 4] Ð Ð CD ý. ý Ð, ý. ( þ Ì ý) CD [ 4] ý., Ð ý ý. Ì Ð Ð ý. [ 3] Ð Ð. TableColumn setcelleditor() Ð ý ý. JTable ý Ð Ð ý. public void setdefaultrenderer(class columnclass, TableCellRenderer renderer) public void setdefaulteditor(class columnclass, TableCellEditor editor) "Class" ý. ( ) ÿ Ð Ð ý. ( ) TableColumn JSTORM <1574>

16 Revision: <1.0> < > setcellrenderer() sefcelleditor() ý. ý [ 3] Volumn æ VolumnRenderer VolumnEditor Ð Ðý. JTable setdefaultrenderer() æ Ð ý. Volume VolumeRender Ð ý Ðý. setdefaulteditor() Volume VolumeEditor ý. [ 3] Ð, Ì public class AudioDemo extends JFrame { public AudioDemo() { super(" CellRenderer, CellEditor "); AudioModel model = new AudioModel(); JTable table = new JTable(model); CellRenderer CellEditor. table.setdefaultrenderer(volume.class, new VolumeRenderer()); table.setdefaulteditor(volume.class, new VolumeEditor()); getcontentpane().add(table.gettableheader(), BorderLayout.NORTH); getcontentpane().add(table, BorderLayout.CENTER); public static void main(string args[]) { new AudioDemo(); [ 4] VolumeRenderer ** Volume * public class VolumeRenderer extends JScrollBar implements TableCellRenderer { public VolumeRenderer() {. super(jscrollbar.horizontal); public Component gettablecellrenderercomponent( JTable table, Object value, boolean isselected, JSTORM <1674>

17 Revision: <1.0> < > boolean hasfocus, int row,int column) { if (value == null) { return this; if (value instanceof Volume) { setvalue(((volume)value).getvolume()); else { setvalue(0); return this; [ 5] VolumeEditor ** Volume * public class VolumeEditor extends JScrollBar implements TableCellEditor {. private Vector m_listeners; private int m_originalvalue; public VolumeEditor() {. super(jscrollbar.horizontal); m_listeners = new Vector(); public Component gettablecelleditorcomponent( JTable table,object value, boolean isselected, int row,int column) { if (value == null) { return this; if (value instanceof Volume) { setvalue(((volume)value).getvolume()); else { setvalue(0); table.setrowselectioninterval(row, row); table.setcolumnselectioninterval(column, column); m_originalvalue = getvalue(); return this; public void cancelcellediting() { fireeditingcanceled(); JSTORM <1774>

18 Revision: <1.0> < > public Object getcelleditorvalue() { return new Integer(getValue()); public boolean iscelleditable(eventobject eo) { return true; public boolean shouldselectcell(eventobject eo) { return true; public boolean stopcellediting() { fireeditingstopped(); return true; public void addcelleditorlistener(celleditorlistener cel) { m_listeners.addelement(cel); public void removecelleditorlistener(celleditorlistener cel) { m_listeners.removeelement(cel); protected void fireeditingcanceled() { setvalue(m_originalvalue); ChangeEvent ce = new ChangeEvent(this); for (int i = m_listeners.size(); i >= 0; i--) { ((CellEditorListener)m_listeners.elementAt(i)).editingCanceled(ce); protected void fireeditingstopped() { ChangeEvent ce = new ChangeEvent(this); for (int i = m_listeners.size() - 1; i >= 0; i--) { ((CellEditorListener)m_listeners.elementAt(i)).editingStopped(ce); Ð þ Ð ý. Ð ý. CD ý ý. Ì Ð ý. Ð Ð ë(celleditorlistener) ý. [ 5] ë ý. editingcanceled() ë, editingstopped() ë ý. JSTORM <1874>

19 Revision: <1.0> < > (4) JTable JTable ý. Ì JTable ý æ ý. JTable Í ÿ Ð ý. Ì ÿ JTable ý. JTable Ð ý. Ì û Document Ð ý. Ð ý Í ý. [ 7] JTable JTable() gettableheader() setdefaultrenderer() setdefaulteditor() setrowselectioninterval() getselectedrow() convertcolumnindextomodel() getvalueat() addcolumn() editcellat() getmodel() ý. Í Ð Ð ý. ì ý. ë í í ý. Ð Ð ý. ý. ( Ì ) æ ý. ý. Ì û API Ú Ð ý. Þ ý. Í ý ý. æý. ý. ( Ì ) ý. Ð ì ý. ý. Ì ý. JTable Ì ý. JTable ý ý. public class JTable extends JComponent implements TableModelListener, Scrollable, TableColumnModelListener, ListSelectionListener, CellEditorListener, Accessible JTable, Ì ý. JTable ý þ ý. JTable TableModel TableColumnModel JSTORM <1974>

20 Java Coding Standard Revision: <1.0> < > Ì CellEditor Ð ý. Ì Ì (implements) ý. ÿ ý. 3. Ì Í ý æ ý. Ì Í Ô Ð (?) Ð û æ ý. ý ý. Ð Í ý. þ ý. Ì ý Ð ý æ Ð Ð ý. ý. Ð ý. 1. Ð 98 Ð (Sorting) Ð ý. Ð Ì Ð ý. Ð ý. Ì ý æ ý. Ì. [ 5] Ð JSTORM <2074>

21 Java Coding Standard Revision: <1.0> < > Ð í?? ý. è Ð ý. Ì Ð í? ûý. è ý Ð ý. ý. Ì? ý. Ð þ Ì ý. Ì ý ý ý. Ì? þ ý. Ð ý. û (Strategy, Policy) 3 ý ý. æ Design Patterns" (Erich Gamma ) Ð ý. ÿ ûð ý. Ì Ð ý Ð ý. ý ý Þ ý. [Ì 2] [Ì 2] ÿ ý. Í Ô Ì ý. ý TableModel JTable ý. Ð ý Ì Sorter Ì ý. Ð ( Ð ý. ^^) ý. Ð ý ý. ý æ ý. Ð ( Ð Ð) Ð ý Ì æ ý. TableModelListener Ð Ð ý. Ð ý ý. MyTableModel mymodel = new MyTableModel(); JSTORM <2174>

22 Java Coding Standard Revision: <1.0> < > TableSorter sorter = new TableSorter(myModel); JTable table = new JTable(sorter); sorter.addmouselistenertoheaderintable(table); Ð TableSorter ý. TableSorter TableModel Ð Ð ý. (TableMap ) ý. Ì ý. Ì ÿ Ð. 1) ý. 2) 1) TableSorter ì ý. 3) TableSorter JTable ì ý. TableSorter TableModel ì ý. 4) addmouselistenertoheaderintable() ý. TableSorter AbstractTableModel ý. ( TableMap AbstractTableModel TableSorter ý TableMap ý) è Ð ý. Ì ÿ ý ( ) æ ý. addmouselistenertoheaderintable() (Column Header) þ Ð ý. Ô Ð ý. 2. (Row Header) Í ý ý. Ì ý ý. Ð Ð ý. Ì Í þ ý. Í ý. Ì. ý. Ì ý. (Column Header) ( ) ý. [ 6] ý ý. ý. ûý. Ì. [ 6] ý JSTORM <2274>

23 Revision: <1.0> < > ý. ý ý ý. ý. TableColumnModel ý ý. ý TableColumnModel ý ý. TableColumnModel ý. ý. ý Ðý. ì MVC Ð ý. Ì (Index=0) ý. ý. TableColumnModel.. TableColumnModel rowheadermodel = new DefaultTableColumnModel() { boolean first = true; public void addcolumn(tablecolumn tc) { if (first) {. tc.setmaxwidth(50); super.addcolumn(tc); first = false;. ; TableColumnModel. JSTORM <2374>

24 Revision: <1.0> < >. TableColumnModel cm = new DefaultTableColumnModel() { boolean first = true; public void addcolumn(tablecolumn tc) {. if (first) { first = false; return;. tc.setminwidth(100); super.addcolumn(tc); ; DefaultTableColumnModel TableColumnModel ý. æ (Anonymous Inner Class) ý. æ ÿ Ð ý. erclasses.doc.html TableColumnModel ý. JTable addcolumn() ý. TableColumnModel ý. Ì TableColumnModel ÿ ý. Ì ý TableColumnModel ý. JTable jt = new JTable(tm, cm);. JTable headercolumn = new JTable(tm, rowheadermodel); jt.createdefaultcolumnsfrommodel(); headercolumn.createdefaultcolumnsfrommodel(); createdefaultcolumnsfrommodel() ý. TableColumnModel addcolumn() Ð ý. ý. Ð ý SelectionModel ý. jt.setselectionmodel(headercolumn.getselectionmodel()); ë þ ý. JViewport ý. JSTORM <2474>

25 Revision: <1.0> < > JViewport jv = new JViewport(); jv.setview(headercolumn); ( ). JScrollPane jsp = new JScrollPane(jt); JScrollPane RowHeader. jsp.setrowheader(jv); þ ý. Í æ Ð ( Ð ý.) æ þ Ð ý. Ì 2 ý. ý ý. API Í ÿ Ð ý. 3. Ð Ì Ì Ð ý. Ì ý. Ð ý. ÿ ì (JTable ) (Model) (View) Ð ý. MVC ( ) ÿ ý ý ý. Ì Ì ý. [ 6] Ì ý. Ì ý. æ ý ý ý. [Ì 3] æ ý. æ ý. TableModelEvent ý ý. ý ý. TableModelEvent ý. TableModelListener ý. ý setvalueat() ý. public void setvalueat(object value, int row, int col) { data[row][col] = (String)value; firetablerowsupdated(row,row); setvalueat() ý. ý firetablerowsupdated() ý. firetablerowsupdated() JSTORM <2574>

26 Java Coding Standard Revision: <1.0> < > AbstractTableModel ý. Ì. TableModelListener ý. TableModelListener tablechanged() ý. ý ý. public void tablechanged(tablemodelevent tme) { updatelocalvalues(tme.gettype()!= TableModelEvent.UPDATE); tablechanged() ý updatelocalvalues() ý. updatelocalvalues() (Structure) (true ) û ý (false ) Ð ý. ý Ü Ð ý. [ 7] [Ì 3] ý JSTORM <2674>

27 Revision: <1.0> < > Ð Lightweight ì ý. Lightweight ì (Sun) Ð ý. Ð ü ý ì ( Ð ). ì û MVC ý. Í ý. ý Ð Ð ý. 4. Í Ðý Ð Í ÿ ý. þ ì ý. Ì û ÿ Ì ìý. Í Ì ý. ý API ý ý ÿ ý. Ì û ÿ ý ÿ Ì Ì API Document ý. ý þ ë æ ÿ ý. JSTORM <2774>

28 Java Coding Standard Revision: <1.0> < > ;7 ë (?) ý. ë Ì ý. ë Ì æ ý. Ì æ ë (Extensibility) (Flexibility) Í ý. ÿ Ð ý. (Architecture) ý. ì ý ì Ì Í ý. ÿ ÿ æ ÿ Ð ý. Ð ë æ Ì ÿ Ð ý. Ì ë ý. 1. (?) ý Ì ý. Ð AWT ý ý ÿ ý.. import javax.swing.*; public class ContainerDemo_1 { public static void main(string s[]) { JFrame frame = new JFrame("Swing Container Demo #1"); JButton button = new JButton("A Button"); (?) frame.getcontentpane().add(button); frame.setsize(300, 200); frame.setvisible(true); [ 1] JFrame ý JSTORM <2874>

29 Revision: <1.0> < > ý ý. frame.getcontentpane().add(button); AWT frame.add(button) getcontentpane()? Í Ì Í ý. frame.add(button) Ì ý ý. Exception in thread "main" java.lang.error: Do not use javax.swing.jframe.add() use javax.swing.jframe.getcontentpane().add() instead at javax.swing.jframe.createrootpaneexception(jframe.java:327) at javax.swing.jframe.addimpl(jframe.java:349) at java.awt.container.add(container.java:206) at ContainerDemo_1.main(ContainerDemo_1.java:8) getcontentpane() Ì Container ý. Ì ý ë? Ì? þð ý. Ì û. Ì Ì Í ææ ý. 2. ë Í ë JApplet, JDialog, JFrame, (JInternalFrame), Ì JWindow ë(top Level Container) ý. ë ý ì þ Ð ý ë þ ý. Ì ì (HeavyweightComponent) ý ý. ( ì ÿ Ð Ð ý.) JInternalFrame ë ÿ AWT ë (extends) ý. JFrame AWT Frame ý.([ì 5] [Ì 6] ) Ð ì ý ý. Ì ë ì ÿ Ð ý. JInternalFrame ë û ( ì ûý.) ý ë Ð ë Í ý. ë Ð ý JFrame ÿ ý. Ì û Ð æ JFrame æ ü Ð ý. [Ì 1] JFrame Ì ý. Ì JFrame Menu Bar Content Pane( ) ý. Menu Bar ì þ JSTORM <2974>

30 Java Coding Standard Revision: <1.0> < > ý. frame.getcontentpane() ý. [Ì 1] JFrame [ 1] ý. (Cyan) (JLabel) ý. [ 1] ë import java.awt.*; import javax.swing.*; public class TopLevelContainerDemo extends JFrame { public TopLevelContainerDemo() { super("top Level Container Demo");. JMenuBar menubar = new JMenuBar(); menubar.setopaque(true); menubar.setbackground(color.cyan); menubar.setpreferredsize(new Dimension(300, 20)); setjmenubar(menubar);. JLabel label = new JLabel(""); label.setopaque(true); label.setbackground(color.yellow); getcontentpane().add(label, BorderLayout.CENTER); setsize(300, 200); setvisible(true); JSTORM <3074>

31 Java Coding Standard Revision: <1.0> < > public static void main(string args[]) { new TopLevelContainerDemo(); [ 2] ë Ð ë ÿ ý. Ì Í ûý. Í ý ý. ë æ ý. 3. ë! [Ì 2] ë æ Ì ý. ý. ý. Ì RootPane( ) ý. ý Ð ý. JFrame ý ý. [Ì 3] æ ý. ë ý. Í Í ý. ë ë RootPaneContainer (implements) ý. [ 1] RootPaneContainer ý. [Ì 3] ý ý. LayeredPane ý GlassPane ý. LayeredPane ý ì ë ý. (Layer) ì ý ý. LayeredPane ý. LayeredPane GlassPane Ð ý. JSTORM <3174>

32 Java Coding Standard Revision: <1.0> < > [Ì 2] JFrame <--- Ì 3 ûý. [Ì 3] JRootPane <--- Ì 3 ûý. <--- Ì GlassPane <---? [ 1] RootPaneContainer JSTORM <3274>

33 Java Coding Standard Revision: <1.0> < > getcontentpane() setcontentpane() getglasspane() setglasspane() getlayeredpane() setlayeredpane() getrootpane() ContentPane ý. GlassPane ý. LayeredPane ý. RootPane ý. 4. GlassPane? GlassPane ý.. GlassPane ([Ì 3]) Ð ý. JPanel setopaque(false); setvisible(false); ý. Ì GlassPane? GlassPane Ú ý. Ì InternalFrame ý. GlassPane ý. [Ì 3] GlassPane ý ý. GlassPane Ì þ ý. GlassPane InternalFrame (Multi-Document) GlassPane ý. [ 3] JSTORM <3374>

34 Revision: <1.0> < > [ 3] ý. æ JInternalFrame ý. æ æ ý. Ì ý æ Ð þ ý. ý. Ì ý. [ 3] Ð æ ý. GlassPane ý. ý æ ( ) Ì æ GlassPane ý.(setvisible(true)) ( Ð GlassPane û æ.) GlassPane ý. Ì Opaque Ð GlassPane ý. GlassPane õ ý. ý Ì æ, GlassPane ý ý (setvisible(false)) æ ý. GlassPane ý. Ì GlassPane. [ 4] Ì ý. GlassPane ý. "GlassPane Ð" õ GlassPane ý. GlassPane Ð GlassPane þ þ GlassPane Ð ý GlassPane Ì ý. GlassPane Ð Ð Ðý. Ì Ì GlassPane Ð Ì ý ý. GlassPane þ Ð ý. [ 2] GlassPane import java.awt.*; import java.awt.event.*; import javax.swing.*; public class GlassPaneDemo extends JFrame implements ActionListener { GlassPane MyGlassPane m_glasspane = new MyGlassPane(); public GlassPaneDemo() { super("glasspane Demo"); JSTORM <3474>

35 Revision: <1.0> < > GlassPane. JButton buttonshowglass = new JButton("GlassPane "); buttonshowglass.addactionlistener(this);. getcontentpane().setlayout(new GridLayout(0, 2)); getcontentpane().add(new JButton(" 1")); getcontentpane().add(new JButton(" 2")); getcontentpane().add(buttonshowglass); getcontentpane().add(new JButton(" 3"));. JMenuBar menubar = new JMenuBar(); menubar.add(new JMenu(" ")); menubar.add(new JMenu(" ")); menubar.add(new JMenu(" ")); setjmenubar(menubar); GlassPane. setglasspane(m_glasspane); <----- [1 ] setsize(300, 200); setvisible(true); public void actionperformed(actionevent e) { GlassPane. m_glasspane.setvisible(true); public static void main(string[] args) { new GlassPaneDemo(); class MyGlassPane extends JPanel implements ActionListener { private Point m_spotlocation; public MyGlassPane() { JButton button = new JButton("GlassPane "); button.addactionlistener(this); JSTORM <3574>

36 Java Coding Standard Revision: <1.0> < > setlayout(new GridBagLayout()); add(button); addmouselistener(new MouseAdapter() { <----- [2 ] public void mouseclicked(mouseevent e) { m_spotlocation = e.getpoint(); System.out.println(m_spotLocation); repaint(); ); public void actionperformed(actionevent e) { GlassPane. setvisible(false); public void paintcomponent(graphics g) {. if (m_spotlocation!= null) { g.setcolor(color.red); g.filloval(m_spotlocation.x-15, m_spotlocation.y-15, 30, 30); [ 4] GlassPane JSTORM <3674>

37 Revision: <1.0> < > [ 2] [1 ] JFrame setglasspane(m_glasspane) GlassPane ý.([ 1] ) [2 ] GlassPane Ì ý ì þ ý Ð ý. Ì GlassPane Ô ý LayeredPane ÿ. 5. LayeredPane AWT ý ý ý. ë ì ý. GlassPane ý. ( Ì æ ý ý.) Ì (Layer) ÿ. ý. [ 3] LayerPane import java.awt.*; import javax.swing.*; public class LayerDemo extends JFrame { public LayerDemo() { super(" Layer "); JLayeredPane layeredpane = getlayeredpane(); JButton top = new JButton(); top.setbackground(color.white); top.setbounds(50, 50, 100, 100); JButton middle = new JButton(); middle.setbackground(color.gray); middle.setbounds(100, 100, 100, 100); JButton bottom = new JButton(); bottom.setbackground(color.black); bottom.setbounds(150, 150, 100, 100);. layeredpane.add(bottom, new Integer(1)); JSTORM <3774>

38 Java Coding Standard Revision: <1.0> < > layeredpane.add(middle, new Integer(2)); layeredpane.add(top, new Integer(3)); setsize(300, 300); setvisible(true); public static void main(string[] args) { new LayerDemo(); [ 3] LayeredPane þ ý. ý þð bottom 1 þ ý. þ ì æ þ ì ý. ì Ì æ ì Ì ì Ì Ì Ð ý. ([ 5] ) [ 5] LayerPane JLayeredPane ì þð add() ý. JLayeredPane Container æ addimpl() ý. addimpl() ý ý. protected void addimpl(component comp, Object layer, int position) comp þ ì layer ì þð ý. layer Object Ð í new Integer(3); Integer ì ý. position ì æý. ì æ ý., position ì æ JSTORM <3874>

39 Revision: <1.0> < > ý. add() position( ) ì æ ý 2 Ë ý. 1. position æ ì Ì ý. 2. position -1 Í ë ì position ì ý position( ) ì ý. ì position Ì ý. position (Layer) ÿ ý. Ì Í ý. A, B, C ì 0, 1, 2 (position) ý. D 1 ý ý. ý E -1 ý ý. ý F 5 ý ý. A B C A D B C A D B C E A D B C E F Ì A, B, C, D, E, F ì Ì? F, E, C, B, D, A Ì ý., position F ý Ì æ position A Ì ý. (Position) (Layer) æ ý. æ æ þ ì þ ì ý Ì ý. JLayeredPane (?) ý. [Ì 4] [ 3] æ ý. ý. Ì Ì Ì ý. Ð ý. ( ý.) Ì û DEFAULT_LAYER+3 Ð ý. Ì LayeredPane ý. [ 4] LayeredPane JSTORM <3974>

40 Revision: <1.0> < > import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; public class LayeredPaneDemo extends JFrame { ** * private String[] m_layernames = { " ", " ", " ", " ", " " ; ** * private Color[] m_layercolors = { Color.yellow, Color.magenta, Color.cyan, Color.red, Color.green ; ** LayeredPane * private JLayeredPane m_layeredpane; ** ( ) * private JLabel m_dukelabel; public LayeredPaneDemo() { super("layeredpane "); LayeredPane. m_layeredpane = new JLayeredPane(); m_layeredpane.setpreferredsize(new Dimension(300, 310)); m_layeredpane.setborder(borderfactory.createtitledborder( ".")); m_layeredpane.addmousemotionlistener(new MouseMotionAdapter() { public void mousemoved(mouseevent e) { m_dukelabel.setlocation(e.getx()-32, e.gety()-32); ); JSTORM <4074>

41 Revision: <1.0> < > Point origin = new Point(10, 20); int offset = 35; LayeredPane. for (int i = 0; i < m_layernames.length; i++) { JLabel label = createcoloredlabel(m_layernames[i], m_layercolors[i], origin); m_layeredpane.add(label, new Integer(i)); origin.x += offset; origin.y += offset; LayeredPane. ImageIcon icon = new ImageIcon("WavingDuke.gif"); m_dukelabel = new JLabel(icon); m_dukelabel.setbounds(15, 225, icon.geticonwidth(), icon.geticonheight()); m_layeredpane.add(m_dukelabel, new Integer(2), 0); LayeredPane. Container contentpane = getcontentpane(); contentpane.setlayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS)); contentpane.add(box.createrigidarea(new Dimension(0, 10))); contentpane.add(createcontrolpanel()); contentpane.add(box.createrigidarea(new Dimension(0, 10))); contentpane.add(m_layeredpane); pack(); setvisible(true); ** JLabel. * private JLabel createcoloredlabel(string text, Color color, Point origin) { JLabel label = new JLabel(text); label.setverticalalignment(jlabel.top); label.sethorizontalalignment(jlabel.center); label.setopaque(true); label.setbackground(color); label.setforeground(color.black); label.setborder(borderfactory.createlineborder(color.black)); label.setbounds(origin.x, origin.y, 140, 140); return label; JSTORM <4174>

42 Revision: <1.0> < > **. * private JPanel createcontrolpanel() { final JCheckBox ontop = new JCheckBox( " (Layer)."); ontop.setselected(true); ontop.addactionlistener(new ActionListener() { public void actionperformed(actionevent e) { if (ontop.isselected()) m_layeredpane.movetofront(m_dukelabel); else m_layeredpane.movetoback(m_dukelabel); ); final JComboBox layerlist = new JComboBox(m_layerNames); layerlist.setselectedindex(2); Cyan layer layerlist.addactionlistener(new ActionListener () { public void actionperformed(actionevent e) { int position = ontop.isselected()? 0 : 1; m_layeredpane.setlayer(m_dukelabel, layerlist.getselectedindex(), position); ); JPanel controls = new JPanel(); controls.add(layerlist); controls.add(ontop); controls.setborder(borderfactory.createtitledborder( " ")); return controls; public static void main(string[] args) { new LayeredPaneDemo(); [ 6] Ì ý. Ð Ð (, ý.) ý. ý ý þ þð ý. position (position ý.) position ý. (position ý.) [ 6] JSTORM <4274>

43 Java Coding Standard Revision: <1.0> < > ý ý. [ 6] LayeredPane 6.! Í ë æ Ð Í æ. ë (JApplet, JDialog, JFrame, JInternalFrame, JWindow) Ì æ (RootPane) ý. ý GlassPane LayeredPane Ì ý. GlassPane Ì ý. GlassPane Ì ý ý. JInternalFrame GlassPane ý ý ý. LayeredPane ì ý. LayeredPane ì æ (Layer) (Position) ý ý. LayeredPane þ ý. Ì ë getcontentpane() ý ý ì í ý. [Ì 5] [Ì 6] ë Ì ý. Ì (JApplet, JDialog, JFrame, JInternalFrame, JWindow, JRootPane, JLayeredPane) JSTORM <4374>

44 Java Coding Standard Revision: <1.0> < > API [Ì 2], [Ì 3], [ 1], [ 2], [ 3] æ Ð ý. [ 2] JRootPane (Attribute) Type JMenuBar menubar. null ý. Container contentpane í ì í ý. JLayeredPane layeredpane (Layer) Ð ì þ ý. þ ý. Component glasspane ý. ý. [Ì 4] JLayeredPane [ 3] JLayeredPane JSTORM <4474>

45 Java Coding Standard Revision: <1.0> < > FRAME_CONTENT_LAYER ý. í ý. ý ý ì ý. DEFAULT_LAYER 0 ÿ ì ý. í ì ý. PALETTE_LAYER 100 ýû ý. MODAL_LAYER 200 þ ý. þ InternalFrame þ ÿ ý. POPUP_LAYER 300 ý ì. ý. DRAG_LAYER 400 Ì ý. Ì ý ý. [Ì 5] ë JSTORM <4574>

46 Revision: <1.0> < > [Ì 6] ë Ì (?) ý. Ð æ Ð ý. ý. Ì ý. Ð Ð Ð ý. Ì Ë Ì Ì Ð ý. Ð ÿ Ð ý. Ð Ô ý. ÿ Ð ý. Ú Ð ý. ý Í ý. Action Ð Action Ð Ð ý þ ý. ý. Ì Ð ý. ý. Ì õ ý. û ý Ð ý. Ì ý! ý. Ð Ð ý. Ì Action ý þ. Action javax.swing ý ý. public interface Action extends ActionListener {... Action ActionListener ý. ActionListener Ð Action actionperformed() Ð ý. Action (implement) Action ý. actionperformed() ý. Action actionperformed() Ð (Action) ý. ý Ð ÿ Ð. Ð JSTORM <4674>

47 Revision: <1.0> < > DocumentSaveAction ý DocumentSaveAction ý ý. public class DocumentSaveAction implements Action {... public void actionperformed(actionevent) { [Ì 6] ý Í Ð ý. ö DocumentSaveAction ActionEvent æ ý. DocumentSaveAction actionperformed() Ì ý. actionperformed() Ð í Ì Ð ý. [Ì 6] Action ý. [Ì 6] Action Action "Design Patterns(Erich Gamma ) "Command Pattern" ý. Ì ý Ú ý. Ì Action(Command) Ð ý. Action (Undoable) Ð ý. Ì Í æ Ð ý ý. Ì Ð Ð ý. Ì. [ 7] Action [ 5] Action import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ActionDemo extends JFrame { public ActionDemo() { super("action "); JSTORM <4774>

48 Revision: <1.0> < > JMenuBar menubar = new JMenuBar(); JToolBar toolbar = new JToolBar();. setjmenubar(menubar); JMenu filemenu = new JMenu(" "); menubar.add(filemenu);. getcontentpane().add(toolbar, BorderLayout.SOUTH); Action. DocumentOpenAction fileopenaction = new DocumentOpenAction(); DocumentSaveAction filesaveaction = new DocumentSaveAction(); Action. filemenu.add(fileopenaction); < [1 ] filemenu.add(filesaveaction); < [1 ] Action. JButton button; button = toolbar.add(fileopenaction); < [2 ] button.settext(null); button = toolbar.add(filesaveaction); < [2 ] button.settext(null); setsize(300, 200); setvisible(true); addwindowlistener(new WindowAdapter() { public void windowclosing(windowevent ev) { System.exit(0); ); public static void main(string s[]) { new ActionDemo(); ** * class DocumentOpenAction extends AbstractAction { JSTORM <4874>

49 Revision: <1.0> < > public DocumentOpenAction() { super(" ", new ImageIcon("DocumentOpen.gif")); public void actionperformed(actionevent e) { JOptionPane.showMessageDialog(null, "."); ** * class DocumentSaveAction extends AbstractAction { public DocumentSaveAction() { super(" ", new ImageIcon("DocumentSave.gif")); public void actionperformed(actionevent e) { JOptionPane.showMessageDialog(null, ".");. setenabled(false); < [3 ] [ 5] [1 ] [2 ] Action ý. JMenu JToolBar add() Action ì Ð ý. add() Action JMenuItem JButton ý. Action setenabled() Ð ý. [3 ] setenabled() false ì [ 7] ý. Action Ð AbstractionAction ý. Action ý. DocumentOpenAction DocumentSaveAction Action AbstractAction ý (Override) ý. ì Ì ý. þ Action æ JSTORM <4974>

50 Revision: <1.0> < > ý. ý. Action ý Ð ý. Ì ý. Ð ý. Action Ð ý ý.? Undoable Ð ý ý. ý ý. [Ì 6] þ ý Ð Action ý. ý Ð ý ý. DocumentSaveAction Ì þ ý. ý. [ 7] Ì (Disabled) ý. ý ý æ ý. DocumentSaveAction æ ý. Ð ý. Ì û? [Ì 6] PropertyChangeEvent ÿ Ð? ActionEvent ÿ Ì ý. Action ý PropertyChangeEvent æ ý. DocumentSaveAction ý PropertyChangeEvent ý. ActionEvent actionperformed() þ PropertyChangeEvent propertychange() þ ý. Í PropertyChangeEvent ý. Action ý. Ð ý. ý VoiceDetector.add(fileSaveAction) ý. ý. Í Í Ì ý. Ð Ð ý Í ý. ý Ð ý. Í Ð ë þ Ð ûý. Ìé Í getcontentpane().add(acomponent); ý. Ì Ì? Ì Í Í ý. JSTORM <5074>

51 Revision: <1.0> < > ý. Ì Ì Ì Ì? GlassPane ý. GlassPane Ì Ì Ì...? û ý. Ì ý Ð ý. Ì ý. ý. - The End - JSTORM <5174>

52 Java Coding Standard Revision: <1.0> < > ì ì (Box Ð ) ì (Lightweight Component) ý. Ì ì ì? Ð æ. ì Ì ÿ ì (Heavyweight Component) ý. ì ý ì ý. Ð ý. ý. AWT ý ý. ( AWT ì ì ý.) Ì Í Ì ý([ì 1]). ( ý ì (peer) ý.) API þ ý ý. ì ý. ì ì ý ý. ì ý. ý. ý æ Ì ý([ì 1]). ( ÿ ì ì ý.) [Ì 1] ì ì ì ì [Ì 1] ý. ì ý. Ì þ ý ý. Ì ý JSTORM <5274>

53 Java Coding Standard Revision: <1.0> < > ý. ì Ì ÿ ý. ì ì Ì Ì æ ûý. Ì ý. [ 1] ì ì Ð ý. [ 1] ì ì ì ì ý ý. ( ý. ì ( ý ý ý.) ý.) Look and Feel ý. ( Look and Feel ý. ( Look and Feel æ ý ý.) ý ý ý. [ 1].) ý. ( : AWT, ý. (Subset) ( Ì ý.) ý Ð ý.) í ý. ( í ý. í ) ( ) ý. ([ 2] ì ý. ì Z-Order ( æ ) ý. ì ý.) [ 1] Look and Feel JSTORM <5374>

54 Java Coding Standard Revision: <1.0> < > Java Look and Feel MacOS Look and Feel Motif Look and Feel Windows Look and Feel [ 2] ì ý. JSTORM <5474>

55 Revision: <1.0> < > JSTORM <5574>

56 Revision: <1.0> < > 7 ì Ì Ë ÿ ý. Ì javax.swing.text(javax.swing.text.html, javax.swing.text.html.parser, javax.swing.text.rtf ) JTextField, JPasswordField, JTextArea, JEditorPane, JTextPane ì Ð ý.([ 1]) ý. [ 1] ì ( ) JTextField ý ý. JPasswordField ý. JTextArea ý ý. ý æ ý ì æ JEditorPane þ ý ý. JTextPane JEditorPane Ð æ ý. ì æ Ì (Icon ) ì ý. ý Ð Ì Ð ý ý Ð Ì ý Ð ûý. ë Ë ü ý. Ð ý Ð ý. ÿ Í Í ý. Ì û ì æ ÿ Ð ý.. þ ì ÿ. Ì Ì ý. Ì ý. 0 9 ý. [ 1] "12345abcde67890" ý. õ ý. õ [ 2] ý. JSTORM <5674>

57 Java Coding Standard Revision: <1.0> < > [ 1] [ 2] AWT ý Ì ý. AWT ý ü ý. Ì Ì ý ý. 1. Ð Ð ý. 2. Ì ÿ ý. 2 ý Ì txtfield.settext(str); str ÿ ý ý. str ü ý? str ý. Ì ý. Ì ý. [ 3] ý Ð [ 4]ý. [ 5] õ ý. Ð ý. [ 3] Ð JSTORM <5774>

58 Java Coding Standard Revision: <1.0> < > [ 4] Ð [ 5] Ð [ 1] Ì ý. Ð ý. Ì Í ý. MVC(Model View Controller)ý. Ì ì MVC Ð. [Ì 1] ì JTextComponent ý. (Ì JTextComponent JComponent ý.) JTextComponent ì ý. Ì ÿ MVC Ð ý. [Ì 1] ì (Ì Text Controls, Plain Text Areas, Styled Text Areas....) JSTORM <5874>

59 Java Coding Standard Revision: <1.0> < > [Ì 2] ì æ (MVC) Ì ý. ì Ì æ ý. MVC ý. Ì Ì Delegate View ý ý. Delegate View Controller (ý ì Ì ý.) ì Ð View ý. ý Í Ì ý. Ì View ý. (MVC ÿ ý û ý Ð MVC ÿ Ú Ð ý.) [Ì 2] ì (Framework) ý Ð. MVC Ì ý. [ 1] æ WholeNumberDocument ý. ( ì Model Document ý.) ý PlainDocument PlainDocument ý AbstractDocument AbstractDocument Document (implements) ý. ý. Ì Ð ì Document ý ý. WholeNumberDocument Document ý ý. PlainDocument는동일한속성의문자들로만이루어진텍스트컴포넌트 (JTextField, JPasswordField, JTextArea) 모델의기본적인내용들을구현하고있다. 따라서자신이직접모델을수정하고싶을때는 PlainDocument 클래스를상속하는자신만의모델클래스를정의한다음필요한메쏘드만오버라이드하는방식을택하면된다. JSTORM <5974>

60 Java Coding Standard Revision: <1.0> < > [ 1] 1. createdefaultmodel() JTextField ý. (WholeNumberDocument) WholeNumberDocument ý. ý ý PlainDocument ý. ý. 2 insertstring() ì ý. offset ý. ì Ð [Ì 3] æ ý. æ offset ý. offset 0 ý. [Ì 3] Offset æ æý. ý str attrset ý. ý Ð attrset AttributeSet ý. AttributeSet ÍÚ Í, þ ý. Ð ý. insertstring() BadLocationException (Exception)ý. (throw) ý. offset ý û ì ý ý. BadLocationException ì. Ð ý. [ 1] import javax.swing.*; import javax.swing.text.*; ** * public class WholeNumberField extends JTextField { public WholeNumberField() { JSTORM <6074>

61 Revision: <1.0> < > super(); public WholeNumberField(int columns) { super(columns); ** * protected Document createdefaultmodel() { < return new WholeNumberDocument(); ** * protected class WholeNumberDocument extends PlainDocument { public void insertstring(int offset, String str, < AttributeSet attrset) throws BadLocationException { char[] source = str.tochararray(); char[] result = new char[source.length]; int j = 0;. for (int i = 0; i < result.length; i++) { if (Character.isDigit(source[i])) result[j++] = source[i]; else { System.err.println(" : " + source[i]);. super.insertstring(offset, new String(result, 0, j), attrset); public static void main(string[] args) { JFrame frame = new JFrame("WholeNumberField Demo"); WholeNumberField field = new WholeNumberField(20); frame.getcontentpane().add(field); JSTORM <6174>

62 Revision: <1.0> < > frame.pack(); frame.setvisible(true); Ì Í æ. 텍스트필드는모델의 insertstring() 메쏘드를통해외부로부터문자열을받아들인다. 따라서이곳에필터링장치를설치해놓으면텍스트필드가원하는방식으로작동하도록할수있다. ì ý. JTextField JTextArea ì ì ý. EditorKit? ì (Controller) (Editor Kit) ý. Ð Ð ý. Ð Action Ð ý. (Action ÿ Ð 5 û Ð ý.) ý Ð Ð Action ý. 5 Ð ý Ì Ð Action þ ý. Ì û ý. ý ý. ý ý ý. HTML ý ý ý. ý. ý ý. [Ì 4] ý. DefaultEditorKit ý StyledEditorKit ý ÍÚ Ì ý ý. StyledEditorKit JTextPane Ð Ð ý. HTMLEditorKit RTFEditorKit ý StyledEditorKit HTML RTF ý ý. [Ì 1] JEditorPane ý Ô ý. JEditorPane Ì ý Ì ÿ JSTORM <6274>

63 Java Coding Standard Revision: <1.0> < > þ ý. ý Ì ý registereditorkitforcontenttype() JEditorPane ý. Ì ý ý. [Ì 4] EditorKit Ì Í ý HTML Viewer. ý Ð Ð Hyper Link Ð ý. Ì ë ý ([ 2]) ë ý. ý JEditorPane URL ì ý. ([ 6]) Ì Ð ý. JEditorPane ý. setpage(string url) Ì ý. setpage() URL URL ý. JEditorPane ý setpage() ý. setpage() URL þ ý Ì ý. HTML Viewer HTMLEditorKit ý. [ 2] ý HTML Viewer import java.io.*; import javax.swing.*; public class HTMLExample { public static void main(string[] args) { JEditorPane pane = null; String url = " try { pane = new JEditorPane(url); JSTORM <6374>

64 Java Coding Standard Revision: <1.0> < > catch (IOException ex) { pane.seteditable(false); JFrame frame = new JFrame("HTML Page Viewer V1.0 ^^"); frame.setcontentpane(new JScrollPane(pane)); frame.setsize(600, 400); frame.setvisible(true); [ 6] HTML Viewer. Í Í Í ý. Ì Ð ý. Ð API ë ý. Ì Ì Ì Ì ÿ (?) ý. Ð (?) Ì ý. Ì Ì ÿ. [ 7] Ì ý. þ Ì û Ì Ì ý. [ 7] û JSTORM <6474>

65 Java Coding Standard Revision: <1.0> < > Ì (Style) ý. Í ý ý. ý ( ) Í ý. ý ý ÍÚ ý Í (Attribute) ý. Style ý ý. Style MutableAttributeSet MutableAttributeSet ý AttributeSet ý. ([Ì 5]) Ð ý ý Ð ý. StyleConstants static ý. StyleConstants ý. StyleConstants.setFontSize(style, int size) ý. style ÍÚ Ð size ý. ý ý StyleConstants.getFontSize(style) style Í Ú Ð ý. [Ì 5] JSTORM <6574>

66 Java Coding Standard Revision: <1.0> < > [ 8] (Attribute) ÿ ý. ÿ [ 3] fillstyle() loadfromstyle() Ð ý. ÿ æ (,, ) ý. [ 3] Ð ** * public class StyleEditor extends Container {... ** * private JComboBox sizecombo;... ** (Attribute). * public void fillstyle(style style) {... String size = (String)sizeCombo.getSelectedItem(); StyleConstants.setFontSize(style, Integer.parseInt(size));... ** (Attribute). * public void loadfromstyle(style style) {... int size = StyleConstants.getFontSize(style); sizecombo.setselecteditem(integer.tostring(size)); [ 8] Ð ÿ JSTORM <6674>

67 Java Coding Standard Revision: <1.0> < > ý ý ý. [ 4] ý. ÿ Ð Í Ð æ Í ý. þ ý ý. ý DefaultStyledDocument ý. Ì DefaultStyledDocument ÿ. ý ý. public class DefaultStyledDocument extends AbstractDocument implements StyledDocument AbstractDocument ý. Ì AbstractDocument ÿ Ð Í ý. ý ÿ Ð ý. ý StyledDocument ý. StyledDocument ý ý. Ú ì ý. (Element) (piece) ý. ý Í ý. ý,, ý Ì ý. Ì ì ý ý. ([Ì 6]) ý Ì ý ý. ý ý. [Ì 6] JSTORM <6774>

68 Revision: <1.0> < > ý ý ý Ð ý. ý ÍÚ Ð 24 ý Ì ý ý ý. Ì ý ý. Ì Ì Ó Ì ý. Ì Ì ý ý. Ì ý Í ý ý Í ý Ð ý. ì ý ý. Ì Í. [ 4] 1 ý. æð ý. [ 7] ÿ ( ý) 128 ý. Ì 128 ÍÚ 24 ßý. Ì 128 æ ý. ý. þ ý. 2 styleupdated() updatestylehash() ÿ ý. [ 4] ** * (Document). * (Element) *. * public class StylishDocument extends DefaultStyledDocument implements DocumentListener { **. * private Hashtable stylehash = new Hashtable(); <--- 1 JSTORM <6874>

69 Revision: <1.0> < >... ** * public StylishDocument() { super(); init(); ** *. * Paragraph *. * protected void init() { adddocumentlistener(this); addtostylehash(getparagraphelement(0)); ** * *. * public void styleupdated(style style) { < Hashtable ht = (Hashtable)styleHash.get(style); if (ht!= null) { Vector cleanup = new Vector(); Enumeration e = ht.keys(); while (e.hasmoreelements()) { Element el = (Element)e.nextElement(); int start = el.getstartoffset(); int end = el.getendoffset(); Style check = getlogicalstyle(start); if (check == style) { DefaultDocumentEvent ev = new DefaultDocumentEvent (start, end-start, DocumentEvent.EventType.CHANGE); firechangedupdate(ev); else { cleanup.addelement(el); JSTORM <6974>

70 Revision: <1.0> < > e = cleanup.elements(); while (e.hasmoreelements()) { Element bad = (Element)e.nextElement(); ht.remove(bad); DocumentListener public void insertupdate(documentevent ev) { updatestylehash(ev); public void removeupdate(documentevent ev) { updatestylehash(ev); public void changedupdate(documentevent ev) { int offset = ev.getoffset(); Element para = getparagraphelement(offset); addtostylehash(para); **. * protected void updatestylehash(documentevent ev) { < DocumentEvent.ElementChange chg = ev.getchange(getdefaultrootelement()); if (chg!= null) { Element[] removed = chg.getchildrenremoved(); for (int i=0; i<removed.length; i++) { removefromstylehash(removed[i]); Element[] added = chg.getchildrenadded(); for (int i=0;i<added.length;i++) { addtostylehash(added[i]); **. * protected void addtostylehash(element para) { AttributeSet attrs = para.getattributes(); if (attrs!= null) { Style style = (Style)attrs.getResolveParent(); if (style!= null) { JSTORM <7074>

71 Revision: <1.0> < > Hashtable ht = (Hashtable)styleHash.get(style); if (ht == null) { ht = new Hashtable(); stylehash.put(style, ht); if (ht.containskey(para) == false) { ht.put(para, new Object()); **. * protected void removefromstylehash(element para) { AttributeSet attrs = para.getattributes(); if (attrs!= null) { Style style = (Style)attrs.getResolveParent(); if (style!= null) { Hashtable ht = (Hashtable)styleHash.get(style); if (ht!= null) { ht.remove(para); [ 5] ** JTextPane. * public class StyleDemo extends JFrame { private StyleEditor styleeditor = new StyleEditor(); private JTextPane textpane; private StylishDocument doc; private JMenu stylemenu; private JMenu setstylemenu; private JMenu modifystylemenu; private Hashtable stylehash = new Hashtable(); public static void main(string[] args) { JFrame frame = new StyleDemo(); frame.setvisible(true); ** JTextPane. * public StyleDemo() { super(" "); doc = new StylishDocument(); JSTORM <7174>

72 Revision: <1.0> < > textpane = new JTextPane(doc); setcontentpane(new JScrollPane(textPane)); JMenuBar menubar = createmenubar(); setjmenubar(menubar); setsize(800, 600); **. * protected JMenuBar createmenubar() { JMenuBar bar = new JMenuBar(); JMenu filemenu = new JMenu(" "); JMenuItem exititem = new JMenuItem(" "); exititem.addactionlistener(new ActionListener() { public void actionperformed(actionevent ev) { System.exit(0); ); filemenu.add(exititem); bar.add(filemenu); stylemenu = new JMenu(" "); JMenuItem createitem = new JMenuItem(" "); createitem.addactionlistener(new ActionListener() { public void actionperformed(actionevent ev) { showstyledialog(); ); setstylemenu = new JMenu(" "); modifystylemenu = new JMenu(" "); stylemenu.add(createitem); stylemenu.add(setstylemenu); stylemenu.add(modifystylemenu); bar.add(stylemenu); <--- 1 addstyletomenus(doc.getstyle(stylecontext.default_style)); return bar; **. * protected void showstyledialog() { JSTORM <7274>

73 Revision: <1.0> < > String[] options = {" ", " "; int opt = JOptionPane.showOptionDialog(this, styleeditor, " ", JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, options[0]); if (opt == 0) { "OK" pressed String name = styleeditor.getstylename(); if (name!= null) { Style oldstyle = doc.getstyle(name); if (oldstyle!= null) { styleeditor.fillstyle(oldstyle); doc.styleupdated(oldstyle); else { Style newstyle = doc.addstyle(name, null); styleeditor.fillstyle(newstyle); addstyletomenus(newstyle); styleeditor.clear(); **. * protected void addstyletomenus(final Style newstyle) { String stylename = newstyle.getname(); JMenuItem newitem = new JMenuItem(styleName); setstylemenu.add(newitem); newitem.addactionlistener(new ActionListener() { public void actionperformed(actionevent ev) { textpane.setlogicalstyle(newstyle); <--- 2 ); newitem = new JMenuItem(styleName); modifystylemenu.add(newitem); newitem.addactionlistener(new ActionListener() { public void actionperformed(actionevent ev) { styleeditor.loadfromstyle(newstyle); showstyledialog(); ); JSTORM <7374>

74 Revision: <1.0> < > Ì ([ 5]) ÿ æ ý. JTextPane (1 ) Ð ÿ Ì JTextPane ý. 2 ý. JTextPane setlogicalstyle() (Caret) ý. ì ÿ ý ý ý. þ JDK API javax.swing.text ý Ð ý. ý Ì æ (Inner Class) ý. û Í ý ý. ý. Ð ý æ í æ ý. Ì ý. Í ý. Ì Ì û ý. Ì Ð ý. ÿ Ð ý. í : : JSTORM <7474>

자바GUI실전프로그래밍2_장대원.PDF

자바GUI실전프로그래밍2_장대원.PDF JAVA GUI - 2 JSTORM http://wwwjstormpekr JAVA GUI - 2 Issued by: < > Document Information Document title: JAVA GUI - 2 Document file name: Revision number: Issued by: Issue Date:

More information

9장.key

9장.key JAVA Programming 1 GUI(Graphical User Interface) 2 GUI!,! GUI! GUI, GUI GUI! GUI AWT Swing AWT - java.awt Swing - javax.swing AWT Swing 3 AWT(Abstract Windowing Toolkit)! GUI! java.awt! AWT (Heavy weight

More information

JMF3_심빈구.PDF

JMF3_심빈구.PDF JMF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: Revision number: Issued by: JMF3_ doc Issue Date:

More information

rmi_박준용_final.PDF

rmi_박준용_final.PDF (RMI) - JSTORM http://wwwjstormpekr (RMI)- Document title: Document file name: Revision number: Issued by: Document Information (RMI)- rmi finaldoc Issue Date: Status:

More information

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여

More information

Microsoft PowerPoint - EEL2 Lecture10 -Swing and Event Handling.pptx

Microsoft PowerPoint - EEL2 Lecture10 -Swing and Event Handling.pptx 전자공학실험 2 1 WEEK10: SWING AND EVENT HANDLING Fall, 2014 건국대전자공학부 Notice: 주별강의 / 실습 /HW 내용 2 Week Date 강의주제 Homework 실습과제 Handouts 1 09월 03일 Orientation Lab1 Lecture0 2 09월 10일 추석 3 09월 17일 Using Objects

More information

JTable과 MVC(Model-View-Controller) 구조 - 모델-뷰-컨트롤러구조는데이터의저장과접근에대한제공은모델이담당하고, 화면표시는뷰, 이벤트의처리는컨트롤러가하도록각역할을구분한구조이다. 즉, 역할의분담을통하여상호간의영향을최소화하고각요소의독립성을보장하여독자

JTable과 MVC(Model-View-Controller) 구조 - 모델-뷰-컨트롤러구조는데이터의저장과접근에대한제공은모델이담당하고, 화면표시는뷰, 이벤트의처리는컨트롤러가하도록각역할을구분한구조이다. 즉, 역할의분담을통하여상호간의영향을최소화하고각요소의독립성을보장하여독자 JTable 에서사용하는 Model 객체 JTable - JTable은데이터베이스의검색결과를 GUI에보여주기위해사용되는컴포넌트이다. 가로와세로로구성된테이블을을사용해서행과열에데이터를위치시킨다. - JTable을사용하는방법은다음과같다. 1 테이블에출력될데이터를 2차원배열에저장한다. Object[][] records = { {..., {..., {... ; 2 제목으로사용할문제열을

More information

11장.key

11장.key JAVA Programming 1 GUI 2 2 1. GUI! GUI! GUI.! GUI! GUI 2. GUI!,,,!! GUI! GUI 11 : GUI 12 : GUI 3 4, JComponent 11-1 :, JComponent 5 import java.awt.*; import java.awt.event.*; import javax.swing.*; public

More information

JMF2_심빈구.PDF

JMF2_심빈구.PDF JMF JSTORM http://wwwjstormpekr Issued by: < > Document Information Document title: Document file name: Revision number: Issued by: JMF2_ doc Issue Date: Status: < > raica@nownurinet

More information

<4D F736F F F696E74202D20C1A63139C0E520B9E8C4A120B0FCB8AEC0DA28B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63139C0E520B9E8C4A120B0FCB8AEC0DA28B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 19 장배치관리자 이번장에서학습할내용 배치관리자의개요 배치관리자의사용 FlowLayout BorderLayout GridLayout BoxLayout CardLayout 절대위치로배치 컨테이너안에서컴포넌트를배치하는방법에대하여살펴봅시다. 배치관리자 (layout manager) 컨테이너안의각컴포넌트의위치와크기를결정하는작업 [3/70] 상당히다르게보인다.

More information

<4D F736F F F696E74202D20C1A63230C0E520BDBAC0AE20C4C4C6F7B3CDC6AE203128B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63230C0E520BDBAC0AE20C4C4C6F7B3CDC6AE203128B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 20 장스윙컴포넌트 1 이번장에서학습할내용 텍스트컴포넌트 텍스트필드 텍스트영역 스크롤페인 체크박스 라디오버튼 스윙에서제공하는기초적인컴포넌트들을살펴봅시다. 스윙텍스트컴포넌트들 종류텍스트컴포넌트그림 텍스트필드 JTextField JPasswordField JFormattedTextField 일반텍스트영역 JTextArea 스타일텍스트영역

More information

10장.key

10장.key JAVA Programming 1 2 (Event Driven Programming)! :,,,! ( )! : (batch programming)!! ( : )!!!! 3 (Mouse Event, Action Event) (Mouse Event, Action Event) (Mouse Event, Container Event) (Key Event) (Key Event,

More information

강의자료

강의자료 Copyright, 2014 MMLab, Dept. of ECE, UOS Java Swing 2014 년 3 월 최성종서울시립대학교전자전기컴퓨터공학부 chois@uos.ac.kr http://www.mmlab.net 차례 2014년 3월 Java Swing 2 2017-06-02 Seong Jong Choi Java Basic Concepts-3 Graphical

More information

gnu-lee-oop-kor-lec10-1-chap10

gnu-lee-oop-kor-lec10-1-chap10 어서와 Java 는처음이지! 제 10 장이벤트처리 이벤트분류 액션이벤트 키이벤트 마우스이동이벤트 어댑터클래스 스윙컴포넌트에의하여지원되는이벤트는크게두가지의카테고리로나누어진다. 사용자가버튼을클릭하는경우 사용자가메뉴항목을선택하는경우 사용자가텍스트필드에서엔터키를누르는경우 두개의버튼을만들어서패널의배경색을변경하는프로그램을작성하여보자. 이벤트리스너는하나만생성한다. class

More information

public class FlowLayoutPractice extends JFrame { public FlowLayoutPractice() { super("flowlayout Practice"); this. Container contentpane = getcontentp

public class FlowLayoutPractice extends JFrame { public FlowLayoutPractice() { super(flowlayout Practice); this. Container contentpane = getcontentp 8 장 1 번 public class MyFrame extends JFrame { public MyFrame(String title) { super(title); this. setsize(400,200); new MyFrame("Let's study Java"); 2번 public class MyBorderLayoutFrame extends JFrame {

More information

중간고사

중간고사 기말고사 담당교수 : 단국대학교응용컴퓨터공학박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한 후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답 에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호 (4 자리숫자 ) 를기입하면성적공고시학번대신암호를 사용할것임. // ArithmeticOperator

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f… Command JSTORM http://www.jstorm.pe.kr Command Issued by: < > Revision: Document Information Document title: Command Document file name: Revision number: Issued by: Issue

More information

Chap12

Chap12 12 12Java RMI 121 RMI 2 121 RMI 3 - RMI, CORBA 121 RMI RMI RMI (remote object) 4 - ( ) UnicastRemoteObject, 121 RMI 5 class A - class B - ( ) class A a() class Bb() 121 RMI 6 RMI / 121 RMI RMI 1 2 ( 7)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Graphical User Interface 배효철 th1g@nate.com 1 목차 자바의 GUI AWT와 Swing 패키지 Swing 클래스의특징 컨테이너와컴포넌트 Swing GUI 만들기 컨테이너와배치 2 자바의 GUI GUI 목적 그래픽이용, 사용자에게이해하기쉬운모양으로정보제공 사용자는마우스나키보드를이용하여쉽게입력 자바 GUI 특징 강력한 GUI 컴포넌트제공

More information

Microsoft PowerPoint - [JAVA프로그래밍]9장GUI

Microsoft PowerPoint - [JAVA프로그래밍]9장GUI 명품 JAVA Programming 1 제 9 장자바 GUI 기초, AWT 와스윙 (SWING) 자바의 GUI(Graphical User Interface) 2 GUI 목적 그래픽이용, 사용자에게이해하기쉬운모양으로정보제공 사용자는마우스나키보드를이용하여쉽게입력 자바 GUI 특징 강력한 GUI 컴포넌트제공 쉬운 GUI 프로그래밍 자바의 GUI 프로그래밍방법 GUI

More information

제8장 자바 GUI 프로그래밍 II

제8장 자바 GUI 프로그래밍 II 제8장 MVC Model 8.1 MVC 모델 (1/7) MVC (Model, View, Controller) 모델 스윙은 MVC 모델에기초를두고있다. MVC란 Xerox의연구소에서 Smalltalk 언어를바탕으로사용자인터페이스를개발하기위한방법 MVC는 3개의구성요소로구성 Model : 응용프로그램의자료를표현하기위한모델 View : 자료를시각적으로 (GUI 방식으로

More information

MasoJava4_Dongbin.PDF

MasoJava4_Dongbin.PDF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: MasoJava4_Dongbindoc Revision number: Issued by: < > SI, dbin@handysoftcokr

More information

Java Programing Environment

Java Programing Environment Lab Exercise #7 Swing Component 프로그래밍 2007 봄학기 고급프로그래밍 김영국충남대전기정보통신공학부 실습내용 실습과제 7-1 : 정규표현식을이용한사용자정보의유효성검사 (ATM 에서사용자등록용도로사용가능 ) 실습과제 7-2 : 숫자맞추기게임 실습과제 7-3 : 은행관리프로그램 고급프로그래밍 Swing Component 프로그래밍 2

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 그래픽사용자인터페이스 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 프레임생성 (1) import javax.swing.*; public class FrameTest { public static void main(string[] args) { JFrame f = new JFrame("Frame Test"); JFrame

More information

05-class.key

05-class.key 5 : 2 (method) (public) (private) (interface) 5.1 (Method), (public method) (private method) (constructor), 3 4 5.2 (client). (receiver)., System.out.println("Hello"); (client object) (receiver object)

More information

<4D F736F F F696E74202D20C1A63138C0E520C0CCBAA5C6AE20C3B3B8AE28B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63138C0E520C0CCBAA5C6AE20C3B3B8AE28B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 18 장이벤트처리 이번장에서학습할내용 이벤트처리의개요 이벤트 액션이벤트 Key, Mouse, MouseMotion 어댑터클래스 버튼을누르면반응하도록만들어봅시다. 이번장의목표 버튼을누르면버튼의텍스트가변경되게한다. 이벤트처리과정 이벤트처리과정 (1) 이벤트를발생하는컴포넌트를생성하여야한다. 이벤트처리과정 (2) 이벤트리스너클래스를작성한다.

More information

No Slide Title

No Slide Title 사건처리와 GUI 프로그래밍 이충기 명지대학교컴퓨터공학과 사건 사건은우리가관심을가질지모르는어떤일이일어나는것을나타내는객체이다. 예를들면, 다음이일어날때프로그램이어떤일을수행해야하는경우에사건이발생한다 : 1. 마우스를클릭한다. 2. 단추를누른다. 3. 키보드의키를누른다. 4. 메뉴항목을선택한다. 2 사건 사건은컴포넌트에서사용자나시스템에의하여발생하는일이다. 자바는사건을나타내는많은사건클래스를제공한다.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 명품 JAVA Essential 1 2 학습목표 1. 이벤트기반 GUI 프로그래밍이해 2. 자바 GUI 패키지이해 3. 스윙으로 GUI 프로그램작성 4. 컨테이너와컴포넌트, 배치 5. FlowLayout 배치관리자활용 6. BorderLayout 배치관리자활용 7. GridLayout 배치관리자활용 8. 배치관리자없는컨테이너만들기 자바의 GUI(Graphical

More information

Microsoft PowerPoint - java1-lecture11.ppt [호환 모드]

Microsoft PowerPoint - java1-lecture11.ppt [호환 모드] Overview Swing Component 514760-1 2018 년봄학기 5/22/2018 박경신 JLabel, ImageIcon JTextField, JTextArea JButton, JCheckBox, JRadioButton JSlider, JComboBox JPanel, JScrollPane, JOptionPane JTable Timer JFileChooser,

More information

DB 에데이터저장을위한입력창설계 - JLabel, JTextField, JButton 을이용한입력창설계 - 2 -

DB 에데이터저장을위한입력창설계 - JLabel, JTextField, JButton 을이용한입력창설계 - 2 - Swing 을이용한 DB 작업 Swing Swing은 AWT와함께 Java2에추가된 GUI 처리패키지이다. AWT는해당컴퓨터의 OS가가지고있는컴포넌트를이용하기때문에사용컴퓨터에종속적인 GUI를제공한다. 그러므로, OS의종류에따라화면에출력되는 GUI가다르게된다. 반면에 Swing은 JVM이직접 Swing 패키지를사용해서구현하기때문에 OS가서로달라도동일한화면을제공하는장점을가지고있다.

More information

<4D F736F F F696E74202D20C1A63233C0E520B1D7B7A1C7C820C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63233C0E520B1D7B7A1C7C820C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 23 장그래픽프로그래밍 이번장에서학습할내용 자바에서의그래픽 기초사항 기초도형그리기 색상 폰트 Java 2D Java 2D를이용한그리기 Java 2D 를이용한채우기 도형회전과평행이동 자바를이용하여서화면에그림을그려봅시다. 자바그래픽데모 자바그래픽의두가지방법 자바그래픽 AWT Java 2D AWT를사용하면기본적인도형들을쉽게그릴수있다. 어디서나잘실행된다.

More information

오버라이딩 (Overriding)

오버라이딩 (Overriding) WindowEvent WindowEvent 윈도우가열리거나 (opened) 닫힐때 (closed) 활성화되거나 (activated) 비활성화될때 (deactivated) 최소화되거나 (iconified) 복귀될때 (deiconified) 윈도우닫힘버튼을누를때 (closing) WindowEvent 수신자 abstract class WindowListener

More information

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다. Eclipse 개발환경에서 WindowBuilder 를이용한 Java 프로그램개발 이예는 Java 프로그램의기초를이해하고있는사람을대상으로 Embedded Microcomputer 를이용한제어시스템을 PC 에서 Serial 통신으로제어 (Graphical User Interface (GUI) 환경에서 ) 하는프로그램개발예를설명한다. WindowBuilder:

More information

12-file.key

12-file.key 11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,

More information

10 이벤트 처리와 그래픽 프로그래밍.key

10 이벤트 처리와 그래픽 프로그래밍.key [ 10 ] ..,..,,,., 2 1. 3 Section 1 p408 (event) (listen) (event listener) 4 Section 1 [ 1: ] [ 2: ] 5 Section 1 (ActionEvent) (MouseEvent) 6 Section 1 EventObject getsource() 7 Section 1 8 Section 1 MouseListener

More information

Microsoft PowerPoint - 14주차 강의자료

Microsoft PowerPoint - 14주차 강의자료 Java 로만드는 Monster 잡기게임예제이해 2014. 12. 2 게임화면및게임방법 기사초기위치 : (0,0) 아이템 10 개랜덤생성 몬스터 10 놈랜덤생성 Frame 하단에기사위치와기사파워출력방향키로기사이동아이템과몬스터는고정종료버튼클릭하면종료 Project 구성 GameMain.java GUI 환경설정, Main Method 게임객체램덤위치에생성 Event

More information

제8장 자바 GUI 프로그래밍 II

제8장 자바 GUI 프로그래밍 II 프로그래머를위한 Java 2, 4 판 제8장자바 GUI 프로그래밍 II 8.1 MVC 스윙모델 MVC (Model, View, Controller) 모델 스윙은 MVC 모델에기초를두고있다. MVC란 Xerox의연구소에서 Smalltalk 언어를바탕으로사용자인터페이스를개발하기위한방법 MVC는 3개의구성요소로구성 Model : 응용프로그램의자료를표현하기위한모델

More information

ch09

ch09 9 Chapter CHAPTER GOALS B I G J A V A 436 CHAPTER CONTENTS 9.1 436 Syntax 9.1 441 Syntax 9.2 442 Common Error 9.1 442 9.2 443 Syntax 9.3 445 Advanced Topic 9.1 445 9.3 446 9.4 448 Syntax 9.4 454 Advanced

More information

11-GUI.key

11-GUI.key 10 (GUI) (Graphical User Interface) AWT/Swing Java java.awt, javax.swing (Event-Driven Programming) :,,,, (event-handler or event-listener), Java (action event), (action listner). Java AWT/Swing (component),

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information

JMF1_심빈구.PDF

JMF1_심빈구.PDF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: Revision number: Issued by: 1_ doc Issue Date:

More information

Microsoft PowerPoint - Java-03.pptx

Microsoft PowerPoint - Java-03.pptx JAVA 프로그래밍 Chapter 19. GUI 프로그래밍 1 GUI 환경에서작동하는프로그램 윈도우프로그램에대하여 텍스트모드프로그램과윈도우프로그램 a) 텍스트모드의프로그램 b) 윈도우프로그램 2 GUI 환경에서작동하는프로그램 -2 윈도우프로그램에대하여 텍스트모드프로그램과윈도우프로그램의구조적차이 3 윈도우프로그램의작성방법 윈도우프로그램의구조 네단계로실행되는윈도우프로그램

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

GeoTools 3D Extension Guide 출시 0.5.0 Soojin Kim, Hyung-Gyu Ryoo 12 월 02, 2017 Modules 1 목차 3 1.1 개요................................................... 3 1.2 Geometry.................................................

More information

Microsoft PowerPoint - java2-lecture5.ppt [호환 모드]

Microsoft PowerPoint - java2-lecture5.ppt [호환 모드] 자바에서 GUI 의종류 자바 GUI & 이벤트처리 514770-1 2017 년봄학기 4/19/2017 박경신 AWT(Abstract Windows Toolkit) 운영체제가제공하는자원을이용하여서컴포넌트를생성한다. SWING 스윙컴포넌트가자바로작성되어있기때문에어떤플랫폼에서도일관된화면을보여줄수있다. AWT AWT(Abstract Windows Toolkit) 자바가처음나왔을때함께배포된

More information

슬라이드 1

슬라이드 1 12 장. GUI 학습목표 GUI 이벤트, 이벤트리스너와이벤트소스그림그리기내부클래스 창 Jframe 의모양 (Metal L&F) Jframe 의모양 (Aqua L&F) 창을만드는방법 1. 프레임 (JFrame) 만들기 JFrame frame = new JFrame(); 2. 위젯만들기 JButton button = new JButton( click me );

More information

Cluster management software

Cluster management software 자바프로그래밍 (OCJP 국제공인자격취득중심 ) 충북대학교정보통신공학부 최민 이벤트처리 지금까지 GUI 를구성하는 Component 의종류와이 Component 들을 Container 위에적절하게배치하기위한 LayoutManager 를학습하였음 앞에서만들었던 GUI 프로그램은모양만그럴듯할뿐, 실제 Button 을누르거나, Frame 우측상단의 X 표시를클릭해도아무런동작을하지않음이벤트처리가포함되어있지않기때문

More information

<4D F736F F F696E74202D20C1A63236C0E520BED6C7C3B8B428B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63236C0E520BED6C7C3B8B428B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 26 장애플릿 이번장에서학습할내용 애플릿소개 애플릿작성및소개 애플릿의생명주기 애플릿에서의그래픽컴포넌트의소개 Applet API의이용 웹브라우저상에서실행되는작은프로그램인애플릿에대하여학습합니다. 애플릿이란? 애플릿은웹페이지같은 HTML 문서안에내장되어실행되는자바프로그램이다. 애플릿을실행시키는두가지방법 1. 웹브라우저를이용하는방법 2. Appletviewer를이용하는방법

More information

Microsoft PowerPoint - lec04_05.ppt [호환 모드]

Microsoft PowerPoint - lec04_05.ppt [호환 모드] JAVA 프로그래밍 4. 그래픽프로그래밍 한동일 학습목표 To be able to write simple GUI applications To display graphical shapes such as lines and ellipses To use colors To display drawings consisting of many shapes To read input

More information

歯제9장.PDF

歯제9장.PDF 9 (Swing) Model-View-Controller 1 8 GUI(Graphic User Interface) GUI (swing) (architecture),,, look and feel AWT 2 (frame work) Kim Topley Core Java Foundation Classes (Prentice Hall 1998) - - ( Model-View-Controller

More information

비긴쿡-자바 00앞부속

비긴쿡-자바 00앞부속 IT COOKBOOK 14 Java P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005 L e c t u r e S c h e d u l e 1 14 PPT API C A b o u t T h i s B o o k IT CookBook for Beginner Chapter

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 1,..... @ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability

More information

Microsoft PowerPoint - 12장_스윙 [호환 모드]

Microsoft PowerPoint - 12장_스윙 [호환 모드] 자바 5.0 프로그래밍 원리를알면 IT 가맛있다 이클립스를활용한자바 A to Z ehanbit.net -1- ehanbit.net chapter 12. Swing -2- ehanbit.net 학습목표 스윙의특징및 AWT 와의차이점에대해알아본다. 스윙의 MVC 구조를알아본다. 스윙에서제공하는컴포넌트에대해알아본다. -3- ehanbit.net 스윙의특징 자바에의

More information

thesis

thesis ( Design and Implementation of a Generalized Management Information Repository Service for Network and System Management ) ssp@nile nile.postech.ac..ac.kr DPE Lab. 1997 12 16 GMIRS GMIRS GMIRS prototype

More information

Microsoft PowerPoint - ÀÚ¹Ù08Àå-1.ppt

Microsoft PowerPoint - ÀÚ¹Ù08Àå-1.ppt AWT 컴포넌트 (1) 1. AWT 패키지 2. AWT 프로그램과이벤트 3. Component 클래스 4. 컴포넌트색칠하기 AWT GUI 를만들기위한 API 윈도우프로그래밍을위한클래스와도구를포함 Graphical User Interface 그래픽요소를통해프로그램과대화하는방식 그래픽요소를 GUI 컴포넌트라함 윈도우프로그램만들기 간단한 AWT 프로그램 import

More information

모든스윙컴포넌트에는텍스트옆에이미지를추가로표시할수있다. ImageIcon image = new ImageIcon("image.gif"); JLabel label = new JLabel(" 이미지레이블 "); label.seticon(image);

모든스윙컴포넌트에는텍스트옆에이미지를추가로표시할수있다. ImageIcon image = new ImageIcon(image.gif); JLabel label = new JLabel( 이미지레이블 ); label.seticon(image); JAVA Programming Spring, 2016 Dongwoo Kang 모든스윙컴포넌트에는텍스트옆에이미지를추가로표시할수있다. ImageIcon image = new ImageIcon("image.gif"); JLabel label = new JLabel(" 이미지레이블 "); label.seticon(image); 이미지버튼을표시하고사용자가버튼을누르면레이블의텍스트를이미지로바꾸어서표시하는프로그램을작성해보자.

More information

5장.key

5장.key JAVA Programming 1 (inheritance) 2!,!! 4 3 4!!!! 5 public class Person {... public class Student extends Person { // Person Student... public class StudentWorker extends Student { // Student StudentWorker...!

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 이벤트처리 손시운 ssw5176@kangwon.ac.kr 이벤트 - 구동프로그래밍 이벤트 - 구동프로그래밍 (event-driven programming): 프로그램의실행이이벤트의발생에의하여결정되는방식 2 이벤트처리과정 3 이벤트리스너 발생된이벤트객체에반응하여서이벤트를처리하는객체를이벤트리스너 (event listener) 라고한다. 4 이벤트처리과정

More information

Microsoft PowerPoint - 06-Chapter09-Event.ppt

Microsoft PowerPoint - 06-Chapter09-Event.ppt AWT 이벤트처리하기 1. 이벤트처리방식 2. 이벤트클래스와리스너 3. 이벤트어댑터 4. 이벤트의종류 이벤트 (Event) 이벤트 사용자가 UI 컴포넌트에대해취하는행위로인한사건이벤트기반프로그래밍 무한루프를돌면서사용자의행위로인한이벤트를청취하여응답하는형태로작동하는프로그래밍 java.awt.event 이벤트처리 AWT 컴포넌트에서발생하는다양한이벤트를처리하기위한인터페이스와클래스제공

More information

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET 135-080 679-4 13 02-3430-1200 1 2 11 2 12 2 2 8 21 Connection 8 22 UniSQLConnection 8 23 8 24 / / 9 3 UniSQL 11 31 OID 11 311 11 312 14 313 16 314 17 32 SET 19 321 20 322 23 323 24 33 GLO 26 331 GLO 26

More information

자바-11장N'1-502

자바-11장N'1-502 C h a p t e r 11 java.net.,,., (TCP/IP) (UDP/IP).,. 1 ISO OSI 7 1977 (ISO, International Standards Organization) (OSI, Open Systems Interconnection). 6 1983 X.200. OSI 7 [ 11-1] 7. 1 (Physical Layer),

More information

자바로

자바로 ! from Yongwoo s Park ZIP,,,,,,,??!?, 1, 1 1, 1 (Snow Ball), /,, 5,,,, 3, 3, 5, 7,,,,,,! ,, ZIP, ZIP, images/logojpg : images/imageszip :, backgroundjpg, shadowgif, fallgif, ballgif, sf1gif, sf2gif, sf3gif,

More information

슬라이드 1

슬라이드 1 13 장. 스윙사용방법 학습목표 레이아웃관리자 스윙구성요소 비트박스프로그램 스윙을알아봅시다 스윙구성요소 구성요소 (Component) 위젯 (widget) 이라고도부름 GUI에집어넣는모든것 텍스트필드, 버튼, 스크롤목록, 라디오버튼등 javax.swing.jcomponent 의하위클래스 대화형구성요소, 배경구성요소로나뉨 JButton JFrame JPanel

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 명품 JAVA Essential 1 2 학습목표 1. 스윙컴포넌트종류이해 2. JLabel로문자열과이미지출력 3. JButton으로버튼만들기 4. JCheckBox로체크박스만들기 5. JRadioButton으로라디오버튼만들기 6. JTextField로한줄입력창만들기 7. JTextArea로여러줄의입력창만들기 8. JList로리스트만들기 9. JComboBox로콤보박스만들기

More information

07 자바의 다양한 클래스.key

07 자바의 다양한 클래스.key [ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 그래픽프로그래밍 손시운 ssw5176@kangwon.ac.kr 자바에서의그래픽 2 자바그래픽의두가지방법 3 간단한예제 4 (1) 프레임생성하기 public class BasicPaint { public static void main(string[] args) { JFrame f = new JFrame(" 그래픽기초프로그램 "); f.setdefaultcloseoperation(jframe.exit_on_close);

More information

교육2 ? 그림

교육2 ? 그림 Interstage 5 Apworks EJB Application Internet Revision History Edition Date Author Reviewed by Remarks 1 2002/10/11 2 2003/05/19 3 2003/06/18 EJB 4 2003/09/25 Apworks5.1 [ Stateless Session Bean ] ApworksJava,

More information

자바 프로그래밍

자바 프로그래밍 5 (kkman@mail.sangji.ac.kr) (Class), (template) (Object) public, final, abstract [modifier] class ClassName { // // (, ) Class Circle { int radius, color ; int x, y ; float getarea() { return 3.14159

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 필드만있는클래스 텔레비젼 2 예제 1. 필드만있는클래스 3 예제 2. 여러개의객체생성하기 4 5 예제 3. 메소드가추가된클래스 public class Television { int channel; // 채널번호 int volume; // 볼륨 boolean

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 그래픽사용자인터페이스 손시운 ssw5176@kangwon.ac.kr 그래픽사용자인터페이스 그래픽사용자인터페이스 (Graphical User Interface, 간단히 GUI) 는컴포넌 트들로구성된다. 2 자바에서 GUI 의종류 GUI AWT(Abstract Windows Toolkit) AWT 는운영체제가제공하는자원을이용하여서컴포넌트를생성

More information

신림프로그래머_클린코드.key

신림프로그래머_클린코드.key CLEAN CODE 6 11st Front Dev. Team 6 1. 2. 3. checked exception 4. 5. 6. 11 : 2 4 : java (50%), javascript (35%), SQL/PL-SQL (15%) : Spring, ibatis, Oracle, jquery ? , (, ) ( ) 클린코드를 무시한다면 . 6 1. ,,,!

More information

PowerPoint Presentation

PowerPoint Presentation public class SumTest { public static void main(string a1[]) { int a, b, sum; a = Integer.parseInt(a1[0]); b = Integer.parseInt(a1[1]); sum = a + b ; // 두수를더하는부분입니다 System.out.println(" 두수의합은 " + sum +

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 그래픽 배효철 th1g@nate.com 1 목차 스윙컴포넌트그리기 자바의그래픽좌표시스템 Graphics 2 스윙컴포넌트그리기 스윙의그리기기본철학 모든컴포넌트는자신의모양을스스로그린다. 컨테이너는자신을그린후자식들에게그리기지시 public void paintcomponent(graphics g) 스윙컴포넌트가자신의모양을그리는메소드 JComponent 의메소드 모든스윙컴포넌트가이메소드를가지고있음

More information

Interstage5 SOAP서비스 설정 가이드

Interstage5 SOAP서비스 설정 가이드 Interstage 5 Application Server ( Solaris ) SOAP Service Internet Sample Test SOAP Server Application SOAP Client Application CORBA/SOAP Server Gateway CORBA/SOAP Gateway Client INTERSTAGE SOAP Service

More information

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형 바에 제네릭스(generics)를 도입하기 위한 연구는 이미 8년 전인 1996년부터라고 한다. 실제로 자바에 제네릭스를 도입하 는 몇 가지 방안들이 논문으로 나오기 시작한 것이 1998년 초임을 감 안하면 무려 8년이 지난 후에야 자바 5.0에 전격 채택되었다는 것은 이것이 얼마나 어려운 일이었나 하는 것을 보여준다. 자바의 스펙을 결정하는 표준화 절차인

More information

歯NetworkKawuiBawuiBo.PDF

歯NetworkKawuiBawuiBo.PDF (2000 12 Jr.) from Yongwoo s Park Java Network KawuiBawuiBo Game Programming from Yongwoo s Park 1 Java Network KawuiBawuiBo Game Programming from Yongwoo s Park 2 1. /... 4 1.1 /...4 1.2 /...6 1.3...7

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

Microsoft PowerPoint - Java7.pptx

Microsoft PowerPoint - Java7.pptx HPC & OT Lab. 1 HPC & OT Lab. 2 실습 7 주차 Jin-Ho, Jang M.S. Hanyang Univ. HPC&OT Lab. jinhoyo@nate.com HPC & OT Lab. 3 Component Structure 객체 (object) 생성개념을이해한다. 외부클래스에대한접근방법을이해한다. 접근제어자 (public & private)

More information

No Slide Title

No Slide Title 그래픽사용자인터페이스 이충기 명지대학교컴퓨터공학과 그래픽사용자인터페이스 그래픽사용자인터페이스 (GUI) 는사람과컴퓨터간의상호작용을위한사람 - 컴퓨터인터페이스 (HCI) 중의하나이다. GUI 는사용자가컴퓨터화면상에있는객체들과상호작용을하는인터페이스이다. 오늘날사실상거의모든컴퓨터플랫폼에서 GUI 가사용되고있다. 2 GUI 프로그래밍 GUI 프로그램은실행시키면메뉴가있는창이뜨고창에는아이콘,

More information

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r Jakarta is a Project of the Apache

More information

Microsoft PowerPoint - java1-lecture11.ppt [호환 모드]

Microsoft PowerPoint - java1-lecture11.ppt [호환 모드] 자바에서의그래픽 그래픽스, 이미지 514760-1 2019 년봄학기 6/4/2019 박경신 자바그래픽의두가지방법 간단한그래픽 // (1) 프레임생성하기 public class BasicPaint { JFrame f = new JFrame(" 그래픽기초프로그램 "); f.setdefaultcloseoperation(jframe.exit_on_close); f.setsize(300,

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 인터페이스, 람다식, 패키지 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 홈네트워킹 public interface RemoteControl { public void turnon(); // 가전제품을켠다. public void turnoff(); // 가전제품을끈다. 인터페이스를구현 public class Television

More information

(Microsoft PowerPoint - LZVNQBAJWGTC.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - LZVNQBAJWGTC.ppt [\310\243\310\257 \270\360\265\345]) GUI 인터페이스의이벤트 학습목표 윈도우환경에서작성된 GUI 인터페이스의이벤트개념을이해한다. 다양한컴포넌트에대한이벤트를처리한다 이벤트란? 자바이벤트란 사용자가키보드, 마우스등의장치로부터 AWT 컴포넌트에발생시키는모든사건을의미 이벤트주도형프로그램은사용자로부터발생된이벤트를처리하여사용자와상호작용을가능하게함 자바이벤트모델 컴퓨터 키보드 운영체제 마우스 이벤트객체자바가상머신이벤트소스객체이벤트리스너객체애플리케이션

More information

10-Java Applet

10-Java Applet JAVA Programming Language JAVA Applet Java Applet >APPLET< >PARAM< HTML JAR 2 JAVA APPLET HTML HTML main( ). public Applet 3 (HelloWorld.html) Applet

More information

2017 년 6 월한국소프트웨어감정평가학회논문지제 13 권제 1 호 Abstract

2017 년 6 월한국소프트웨어감정평가학회논문지제 13 권제 1 호 Abstract 2017 년 6 월한국소프트웨어감정평가학회논문지제 13 권제 1 호 Abstract - 31 - 소스코드유사도측정도구의성능에관한비교연구 1. 서론 1) Revulytics, Top 20 Countries for Software Piracy and Licence Misuse (2017), March 21, 2017. www.revulytics.com/blog/top-20-countries-software

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 4 (Object) (Class) (Instance) (Method) (Constructor) Memory 1 UML 1 @ & 1 (Real World) (Software World) @ &.. () () @ & 2 (Real World) (Software World) OOA/ Modeling Abstraction Instantiation

More information

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사) Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

제1장 자바 언어 소개

제1장 자바 언어 소개 프로그래머를위한 Java 2 제7장이벤트프로그래밍 참고 : 구버전 (2005 년이전 ) 의 7 장이벤트프로그래밍 7.2 : AWT event 7.3 : Swing event 신버전 (2006 년이후 ) 의 7.3 : 이벤트부분 이벤트 ( 신 7.3) 2 이벤트 사용자의액션혹은시스템의어떤사건 이벤트드리븐프로그래밍 이벤트분류 Low level event 세부적인이벤트

More information

歯Writing_Enterprise_Applications_2_JunoYoon.PDF

歯Writing_Enterprise_Applications_2_JunoYoon.PDF Writing Enterprise Applications with Java 2 Platform, Enterprise Edition - part2 JSTORM http//wwwjstormpekr Revision Document Information Document title Writing Enterprise Applications

More information

교육자료

교육자료 THE SYS4U DODUMENT Java Reflection & Introspection 2012.08.21 김진아사원 2012 SYS4U I&C All rights reserved. 목차 I. 개념 1. Reflection 이란? 2. Introspection 이란? 3. Reflection 과 Introspection 의차이점 II. 실제사용예 1. Instance의생성

More information

Dialog Box 실행파일을 Web에 포함시키는 방법

Dialog Box 실행파일을 Web에 포함시키는 방법 DialogBox Web 1 Dialog Box Web 1 MFC ActiveX ControlWizard workspace 2 insert, ID 3 class 4 CDialogCtrl Class 5 classwizard OnCreate Create 6 ActiveX OCX 7 html 1 MFC ActiveX ControlWizard workspace New

More information

Microsoft Word - java18-1-final-answer.doc

Microsoft Word - java18-1-final-answer.doc 기말고사 담당교수 : 단국대학교응용컴퓨터공학박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호 (4자리숫자 ) 를기입하면성적공고시학번대신암호를사용할것임. 1. 다음 sub1 과 sub2

More information

mytalk

mytalk 한국정보보호학회소프트웨어보안연구회 총괄책임자 취약점분석팀 안준선 ( 항공대 ) 도경구 ( 한양대 ) 도구개발팀도경구 ( 한양대 ) 시큐어코딩팀 오세만 ( 동국대 ) 전체적인 그림 IL Rules Flowgraph Generator Flowgraph Analyzer 흐름그래프 생성기 흐름그래프 분석기 O parser 중간언어 O 파서 RDL

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 명품 JAVA Essential 1 2 학습목표 1. 스윙컴포넌트그리기와 paintcomponent() 활용 2. Graphics 객체에대한이해 3. 도형그리기와칠하기 4. 이미지그리기 5. repaint() 활용하기 6. 마우스와그래픽응용 스윙컴포넌트그리기, paintcomponent() 3 스윙의페인팅기본 모든컴포넌트는자신의모양을스스로그린다. 컨테이너는자신을그린후그위에자식컴포넌트들에게그리기지시

More information

Orcad Capture 9.x

Orcad Capture 9.x OrCAD Capture Workbook (Ver 10.xx) 0 Capture 1 2 3 Capture for window 4.opj ( OrCAD Project file) Design file Programe link file..dsn (OrCAD Design file) Design file..olb (OrCAD Library file) file..upd

More information