[Swing] JFrame 계산기 만들기
Java2020. 7. 4. 15:13[Swing] JFrame 계산기 만들기

package swing.frame; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextField; public class Calculator extends JFrame { public Calculator(String title) { //this없어도됨 //title설정 setTitle(title); //size설정(width,height) setSize(230, 400);..

[Swing] GridLayoutFrame
Java2020. 7. 4. 15:05[Swing] GridLayoutFrame

package swing.frame; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class GridLayoutFrame extends JFrame { public GridLayoutFrame(String title) { //this없어도됨 //title설정 setTitle(title); //size설정(width,height) setSize(300, 300); //위치 설정(x,y) setLocation(800, 300); //종료관리(보통 EXIT_ON_CLOSE를 사용, 상수3) s..

[Swing] BorderLayout
Java2020. 7. 4. 14:59[Swing] BorderLayout

Swing의 기본 레이아웃은 BorderLayout이기 때문에 선언을 해주지 않아도 괜찮다. package swing.frame; import java.awt.BorderLayout; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; public class BorderLayoutFrame extends JFrame { public BorderLayoutFrame(String title) { //this없어도됨 //title설정 setTitle(title); //size설정(width,height) setSize(300, 300); //위치 설정(x,y) setLocation(800, 300); //종료관리(..

[Swing] FlowLayout
Java2020. 7. 4. 14:37[Swing] FlowLayout

package swing.frame; import java.awt.FlowLayout; import javax.swing.JButton; import javax.swing.JFrame; public class FlowLayoutFrame extends JFrame { public FlowLayoutFrame(String title) { //this없어도됨 //title설정 setTitle(title); //size설정(width,height) setSize(300, 300); //위치 설정(x,y) setLocation(800, 300); //종료관리(보통 EXIT_ON_CLOSE를 사용, 상수3) setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //레이아웃 setL..

[안드로이드 기본] 커스텀 뷰를 사용하여 그리기
Java/Android2020. 5. 18. 16:30[안드로이드 기본] 커스텀 뷰를 사용하여 그리기

package com.example.graphic; import androidx.appcompat.app.AppCompatActivity; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.os.Bundle; import android.view.View; class MyView extends View { public MyView(Context context){ super(context); setBackgroundColor(Color.BLUE); } protected void onDraw(Canvas can..

image