Commit eb723d7f authored by 9731301's avatar 9731301

add initial part

parents
Pipeline #5320 failed with stages
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_10" default="true" project-jdk-name="10" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/JTankTrouble.iml" filepath="$PROJECT_DIR$/JTankTrouble.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0b3d586d-9f0f-4ca4-b09d-03a200e1e684" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="ProjectId" id="1dzFnqOFYxXXFNWi9beGa9Sc8UF" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="aspect.path.notification.shown" value="true" />
</component>
<component name="RecentsManager">
<key name="CreateClassDialog.RecentsKey">
<recent name="UI" />
</key>
</component>
<component name="RunManager">
<configuration name="Main" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="UI.Main" />
<module name="JTankTrouble" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="UI.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Application.Main" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="0b3d586d-9f0f-4ca4-b09d-03a200e1e684" name="Default Changelist" comment="" />
<created>1593420189445</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1593420189445</updated>
<workItem from="1593420197831" duration="14275000" />
<workItem from="1593598248640" duration="34000" />
<workItem from="1593723764237" duration="20000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="574" y="122" key="#com.intellij.ide.util.MemberChooser" timestamp="1593430072090">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="574" y="122" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1593430072090" />
<state x="566" y="298" width="403" height="237" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes" timestamp="1593430104059">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="566" y="298" width="403" height="237" key="#com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesDialog.classes/0.0.1536.824@0.0.1536.824" timestamp="1593430104059" />
<state width="1493" height="210" key="GridCell.Tab.0.bottom" timestamp="1593457418246">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1493" height="210" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1593457418246" />
<state width="1493" height="210" key="GridCell.Tab.0.center" timestamp="1593457418246">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1493" height="210" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1593457418246" />
<state width="1493" height="210" key="GridCell.Tab.0.left" timestamp="1593457418246">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1493" height="210" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1593457418246" />
<state width="1493" height="210" key="GridCell.Tab.0.right" timestamp="1593457418246">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1493" height="210" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1593457418246" />
<state x="107" y="201" key="com.intellij.ide.util.TipDialog" timestamp="1593723763226">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="107" y="201" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1593723763226" />
<state x="209" y="33" key="new project wizard" timestamp="1593723788909">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="209" y="33" key="new project wizard/0.0.1536.824@0.0.1536.824" timestamp="1593723788909" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
package UI;
import javax.swing.*;
public class InitialFrame extends JFrame {
private MainInitialPanel mainInitialPanel;
public InitialFrame(String title) {
super(title);
mainInitialPanel = new MainInitialPanel();
add(mainInitialPanel);
}
}
package UI;
import javax.swing.*;
public class Main {
public static void main (String [] args){
InitialFrame initialFrame = new InitialFrame("tank trouble");
initialFrame.setLocation(200,200);
initialFrame.setSize(400, 400);
initialFrame.setVisible(true);
initialFrame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
package UI;
import javax.swing.*;
public class MainFrame extends JFrame {
public MainFrame (){
MainPanel mainPanel = new MainPanel();
this.add(mainPanel);
this.pack();
}
}
package UI;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class MainInitialPanel extends JPanel{
public MainInitialPanel(){
initComponents();
}
public void initComponents(){
JTextField gottenSecretCode = new JTextField();
gottenSecretCode.setPreferredSize(new Dimension(gottenSecretCode.getWidth()+200 , gottenSecretCode.getHeight()+30));
JButton logInBtn = new JButton("log in");
JButton regBtn = new JButton("sign up");
logInBtn.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
if (true){
MainFrame mainFrame = new MainFrame();
mainFrame.setVisible(true);
}
else {
JOptionPane.showMessageDialog(logInBtn,"error");
}
}
});
regBtn.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
JFrame registration = new JFrame();
registration.add(setRegistrationPanel());
registration.setVisible(true);
}
});
this.setLayout(new GridLayout(4,1));
add(setUserNamePanel());
add(setPassPanel());
add(logInBtn);
add(regBtn);
}
private JPanel setUserNamePanel(){
JPanel userNamePanel = new JPanel();
JLabel label = new JLabel("user name");
JTextField userName = new JTextField();
userName.setPreferredSize(new Dimension(userName.getWidth() + 200,userName.getHeight()+ 30));
userNamePanel.add(label);
userNamePanel.add(userName);
return userNamePanel;
}
private JPanel setPassPanel(){
JPanel passPanel = new JPanel();
JLabel label = new JLabel("password");
JTextField pass = new JTextField();
pass.setPreferredSize(new Dimension(pass.getWidth() + 200,pass.getHeight()+ 30));
passPanel.add(label);
passPanel.add(pass);
return passPanel;
}
private JPanel setRegistrationPanel(){
JPanel regPanel = new JPanel();
JPanel fieldsPanel = new JPanel(new GridLayout(4,2));
JLabel tankNameLabel = new JLabel("Name your tank");
JTextField tankName = new JTextField();
JLabel password = new JLabel("password");
JTextField passwordField = new JTextField();
JLabel passwordRp = new JLabel("password");
JTextField passwordRepField = new JTextField();
JLabel email = new JLabel("Email address");
JTextField emailField = new JTextField();
JButton saveBtn = new JButton("sign up");
fieldsPanel.add(tankNameLabel);
fieldsPanel.add(tankName);
fieldsPanel.add(password);
fieldsPanel.add(passwordField);
fieldsPanel.add(passwordRp);
fieldsPanel.add(passwordRepField);
fieldsPanel.add(email);
fieldsPanel.add(emailField);
regPanel.add(fieldsPanel);
regPanel.add(saveBtn);
return regPanel;
}
}
package UI;
import javax.swing.*;
public class MainPanel extends JPanel {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment