최근에 고등학교에서 Computer Science 수업을 통해 Java에 입문했으며 학교에서 배운 기초 이상을 배우려고합니다. 어제 저는 Swing으로 작성된 Aqua라는 매우 간단한 텍스트 편집기를 디자인했습니다. 웬일인지, 나는이 방법을 실행할 때 컴퓨터가 조금씩 끌린다. 내가 진절머리 나는 컴퓨터를 가지고 있거나 내가 잘못한 것을 작성했기 때문입니까? 감사!자바 스윙 성능
private void save(String content, String name) throws IOException{
System.out.println(dir.toString());
if(i<1){
dirCreation();
i++;
}
try{
String savedText;
savedText = content;
System.out.println(savedText);
File newTextFile;
newTextFile = new File(newDir.toString() + "\\" + name + ".aqua");
System.out.println(newDir.toString() + "\\" + name + ".aqua");
if (!newTextFile.exists()) {
System.out.println("Created new File");
newTextFile.createNewFile();
}
try (FileWriter fw = new FileWriter(newTextFile)) {
fw.write(savedText);
}
}
catch(IOException x){
System.err.format("IOException: %s%n", x);
}
}
private void load(String name) throws FileNotFoundException, IOException{
if(i<1){
dirCreation();
i++;
}
File loadingFile;
loadingFile = new File(newDir + "\\" + name + ".aqua");
Scanner scan = new Scanner(loadingFile);
String out = "";
while (scan.hasNextLine()) {
String line = scan.nextLine();
out+=line + "\n";
}
jTextArea1.setText(out);
}
죄송합니다. 그러나 이것은 코드 리뷰 서비스가 아닙니다. 가지고 계신 분이라면 구체적인 질문을하십시오. – sashkello
대신 http://codereview.stackexchange.com/에 게시하십시오. – mshsayem
@ bigfoot675 지금 'code review' (으)로 이동하십시오! –