停车场管理系统页面实现(1)登陆页面设计

首先,用HTML搭建页面框架,具体代码如下:

<div class="background">

        <div class="dl">

            <form name="f" οnsubmit="check(this)">

                <h1 align="center">停车场管理系统</h1>

                <h3 align="center">账号<input type="text" class="text" id="name" placeholder="请输入账号" autofocus></h3>

                <h3 align="center">密码<input type="password" id="password" class="password" placeholder="请输入密码"

                        autofocus></h3>

                <input type="button" οnclick="check(this)" value="登陆" class="but">

                <a href="./wjmm.html">忘记密码</a>

                <a href="./xyh.html">新用户注册</a>

            </form>

        </div>

    </div>

接着配置css样式:

.background{

    height: 100vh;

    background-image: url("../img/tt.jpg");

    background-repeat: no-repeat;

    background-attachment: fixed;

    background-size: 100% 100%;

}

.dl{

    width: 300px;

    height: 300px;

    background-color: white;

    border: 1px solid black;

    text-align: center;

    position: absolute;

    margin: 100px 700px 300px;

}

h1{

    padding-top: 35px;

}

h3{

    padding-top: 20px;

}

.but{  

    width: 100px;

    background-color: aqua;

    position: relative;

    left: 90px;

    top: 10px;

}

a{

    position: relative;

    right: 30px;

    top: 50px;

}

 最后,添加js,完成页面的登陆功能:

 

function check(thisform) {

    var name = document.getElementById("name").value;//获取用户名

    var pass = document.getElementById("password").value;//获取密码

    if (name == "admin" && pass == '123456') {//登陆用户名与密码

        alert("登陆成功!");

        window.document.f.action = "index.html";//跳转下一页

        window.document.f.submit();

    }

    else {

        alert("用户名或密码错误!");

    }

}

  • 3
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
public class ShowCenter { /** * 在中间位置显示窗体 * @param frame 要显示的窗体 */ public static void centerShowJFrame(JFrame frame) { //定义工具包:Toolkit.getDefaultToolkit() //获取屏幕的尺寸 Dimension screenSize Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = frame.getSize();//窗口的尺寸 //获得窗口高frameSize.height //获取屏幕的高screenSize.height //如果窗口的高度大于屏幕的高度,则以屏幕的高度为准 if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } //获得窗口宽frameSize.width //获取屏幕的宽screenSize.width if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } //设置中间位置 frame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); //设置窗口可见 frame.setVisible(true); } public static void centerShowJFrame(JDialog dialog) { //定义工具包:Toolkit.getDefaultToolkit() //获取屏幕的尺寸 Dimension screenSize Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension frameSize = dialog.getSize();//窗口的尺寸 //获得窗口高frameSize.height //获取屏幕的高screenSize.height //如果窗口的高度大于屏幕的高度,则以屏幕的高度为准 if (frameSize.height > screenSize.height) { frameSize.height = screenSize.height; } //获得窗口宽frameSize.width //获取屏幕的宽screenSize.width if (frameSize.width > screenSize.width) { frameSize.width = screenSize.width; } //设置中间位置 dialog.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); //设置窗口可见 dialog.setVisible(true); } }

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

前端菜鸟 阿皮

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值