esoe
3 years ago
20 changed files with 117 additions and 3 deletions
@ -0,0 +1,78 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
import java.awt.Color; |
||||||
|
import java.awt.event.ActionEvent; |
||||||
|
import java.awt.event.ActionListener; |
||||||
|
|
||||||
|
import javax.swing.BorderFactory; |
||||||
|
import javax.swing.JButton; |
||||||
|
import javax.swing.JFrame; |
||||||
|
import javax.swing.JLabel; |
||||||
|
import javax.swing.JPanel; |
||||||
|
import javax.swing.JPasswordField; |
||||||
|
import javax.swing.JTextField; |
||||||
|
import javax.swing.WindowConstants; |
||||||
|
import javax.swing.border.LineBorder; |
||||||
|
import javax.swing.border.TitledBorder; |
||||||
|
|
||||||
|
import ru.egspt.moodle.Access; |
||||||
|
|
||||||
|
public class Account extends JPanel{ |
||||||
|
private JLabel loginLabel = new JLabel("Имя пользователя: "); |
||||||
|
private JTextField loginField = new JTextField(25); |
||||||
|
private JLabel passLabel = new JLabel("Пароль: "); |
||||||
|
private JPasswordField passField = new JPasswordField(25); |
||||||
|
private JLabel urlLabel = new JLabel("Адрес сервера: "); |
||||||
|
private JTextField urlField = new JTextField(25); |
||||||
|
private JButton connButton = new JButton("Подключиться"); |
||||||
|
private JButton connCloseButton = new JButton("Отключиться"); |
||||||
|
|
||||||
|
public Account(){ |
||||||
|
loginField.setText("esoe");//значения по умолчанию
|
||||||
|
urlField.setText("www.egspt.ru");//значения по умолчанию
|
||||||
|
this.add(loginLabel); |
||||||
|
this.add(loginField); |
||||||
|
this.add(passLabel); |
||||||
|
this.add(passField); |
||||||
|
this.add(urlLabel); |
||||||
|
this.add(urlField); |
||||||
|
|
||||||
|
this.add(connButton); |
||||||
|
this.add(connCloseButton); |
||||||
|
TitledBorder border = new TitledBorder(new LineBorder(Color.black), "connection to mysql", TitledBorder.CENTER, TitledBorder.CENTER); |
||||||
|
this.setBorder(border); |
||||||
|
//this.setBorder(BorderFactory.createTitledBorder("аккаунт сервера базы данных"));
|
||||||
|
this.setSize(320, 240); |
||||||
|
this.setVisible(true); |
||||||
|
} |
||||||
|
public void init(){ |
||||||
|
JFrame mainframe = new JFrame("connaction"); |
||||||
|
mainframe.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
||||||
|
mainframe.add(this); |
||||||
|
mainframe.setSize(320, 240); |
||||||
|
mainframe.setVisible(true); |
||||||
|
|
||||||
|
//настройка кнопки connButton
|
||||||
|
connButton.addActionListener(new ActionListener() { |
||||||
|
public void actionPerformed(ActionEvent e) { |
||||||
|
System.out.println("Нажата кнопка Connect"); |
||||||
|
Access.setUserName(loginField.getText()); |
||||||
|
Access.setPassword(String.valueOf(passField.getPassword())); |
||||||
|
Access.setUrl(urlField.getText()); |
||||||
|
//tmpFrame.dispose();
|
||||||
|
System.out.println(Access.getUserName()); |
||||||
|
System.out.println(Access.getPassword()); |
||||||
|
System.out.println(Access.getURL()); |
||||||
|
mainframe.dispose(); |
||||||
|
} |
||||||
|
}); |
||||||
|
} |
||||||
|
public static void main( String[] args ) |
||||||
|
{ |
||||||
|
System.out.println( "Проверка работоспособности класса Account ..." ); |
||||||
|
Account acc = new Account(); |
||||||
|
acc.init(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
public class Controls { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
public class CurrentList { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
public class CurrentTag { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
public class ReportUser { |
||||||
|
|
||||||
|
} |
@ -0,0 +1,5 @@ |
|||||||
|
package ru.egspt.moodle.panel; |
||||||
|
|
||||||
|
public class Users { |
||||||
|
|
||||||
|
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue