2021-08-05

This commit is contained in:
2021-08-05 18:59:45 +09:00
parent c1083a6884
commit 7bb5ca68c1
2 changed files with 4 additions and 8 deletions

View File

@@ -2,9 +2,9 @@ package kr.pe.elex.examples;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import javax.swing.*;
@@ -13,12 +13,10 @@ public class Application implements CommandLineRunner {
@Autowired
private JFrame window;
//@Autowired
//private MyPanel contentPane;
public static void main(String[] args) {
ConfigurableApplicationContext context
= new SpringApplicationBuilder(Application.class)
new SpringApplicationBuilder(Application.class)
.web(WebApplicationType.NONE)
.headless(false)
.run(args);
//SpringApplication.run(Application.class, args);

View File

@@ -10,8 +10,7 @@ import java.awt.*;
@Slf4j
@Component
public class MyPanel extends JPanel {
//@Autowired
//private JFrame window;
@Autowired
private MyService service;
@@ -24,7 +23,6 @@ public class MyPanel extends JPanel {
this.add(btn, BorderLayout.SOUTH);
btn.addActionListener(e -> {
//System.out.println(window.getTitle());
System.out.println(service.getText());
});
}