본문 바로가기

JavaCode(review)

(51)
반응형
intelliJ 설치/구축 환경/ 교육용라이선스 / tomcat 연동방법 설치. 구축 atoz-develop.tistory.com/entry/JAVA-%EA%B0%9C%EB%B0%9C-%ED%99%98%EA%B2%BD-%EA%B5%AC%EC%B6%95-JDK-11-IntelliJ-%EC%84%A4%EC%B9%98-%EB%B0%8F-%EA%B8%B0%EB%B3%B8-%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95 JAVA 개발 환경 구축 - JDK, IntelliJ 설치 및 기본 환경 설정 JAVA 개발 환경 구축하기 1. JDK 설치 2. IntelliJ IDEA 설치 3. 기본 환경 설정 1. JDK 다운로드 및 설치 무료로 사용 가능한 OpenJDK인 Amazon Correto를 다운로드받아 설치한다. 이 외에 다른 Vendor의 배포판.. atoz-d..
java fx - other layouts -Flow pane layout : window사이즈 작을시 부족하다고 내용 짤리지 않음. 다 내보냄. wraps its children // when use? 얼마나 많은 children wrap 할지 모를때 씀. -Vbox layout/ Hbox layout : window 사이즈 작으면 걍 내용 cut off (......child) -Tile pane layout : same width (every cell), there are gap between every button, button의 글씨 가운데 정렬 내용 안짤림. -Stack pane layout : 가운데 덮어씌어지며......(포토샵 이미지 같은거처럼 쓰일때 쓴다 생각) 간단 표 참고하면 좋을 듯. https://m.blog.naver...
java fx - BorderPane Layout most commnly used layouts ofr top-level windows. borderPane.alignment 이용. cf)Hbox Layout : 주로 child 예시) BorderPane Lyout - child : Hbox Layout 이미 borderPane의 .....이라 top-right이 그냥 bottom-right으로 적용 bottom 안에hbox 넣어야 적용된다. top위치에 글자 추가 Label text ..but alighnmnet center 적용 x BorderPane.alignment 사용해야함. 정리코딩(옆 Output) Main package sample; import javafx.application.Application; import javafx.fxml.F..
java fx - Hbox Layout horizentally 수평 cf) Vbox Layout (related to Hbox Layout) :vertically 주로 child of another layout 으로 쓰임. 총코딩 Main package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage primaryStage) throws Exception{ Parent root ..
java fx - GridPane Layout alignment => center, top_center, bottom_right.....etc. Basic GrindPane Layout. Button 5개 추가. - 버튼들이 겹쳐서 나온다. rowIndex, columnIndex을 추가하면 define한대로 나열된다.(index 0,0..) ( GrindPane default도 적용되면서> alignment = center, hgap= 10 pixel, vagp = 10pixel // 버튼이 cetner에 위치하며 버튼 gap들이 10) grindLinesVisible = "true" 추가해보자. (라인보이게 해보자) > column 사이즈들은 글자수에 맞게 맞춰진다. columnConstraints를 추가해보자. (column 사이즈를 바꿔보자.)..
java fx - 글쓰기, 글색/진하게/크기 변경 등. 방법2가지 1. Main에 직접 코딩. 2. sample.fxml 불러오기(sample.fxml에 코딩하기) 1. sample.fxml 대신 Main에 직접 코딩 시, package sample; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.geometry.Pos; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.paint.Color; import javafx.scene.text.Font;..
collections challenge 종합 참고) default V getOrDefault(Object key, V defaultValue) 찾는 키가 존재한다면 찾는 키의 값을 반환하고 없다면 기본 값을 반환한다. int inBasket = list.getOrDefault(item, 0); Main Class- StockList Class - StockItem Class - Basket Class (hashMap) (treeMap) >HashMap-> for문만 이용 출력 or for-Entry 이용 출력 >ternary operation (boolean ? true : false) 이용 // 예) 사이즈가 1이면 "item", 아니면 "items" String s = ((list.size() == 1) ? " item" : " items") ..
Map.entry -collections / unmodifiable Map Map은 entrySet, keySet 이용하여 iterator사용 (걍 for문만 이용해도 됨.) ex) for(Map.Entry m :hashmap.entrySet()){ System.out.println(" 번호 " +m.getKey() + "국가"+m.getValue() ); ->오류뜨면 sout안에 string 넣어봐. } ex)--------------------------------------------collections challenge 종합예시(https://gb-codingworld.tistory.com/68) 1.for문만 이용 key값만 출력. for(String s: stockList.Items().keySet()) { System.out.println(s); } 2. Map.E..