资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

安卓登录页面java代码 登录界面java代码

java制作一个android登陆界面 要求输入的密码非明文 怎么破?

如果是密码非明文,只要在EditView中设置一个属性就可以了

目前创新互联公司已为超过千家的企业提供了网站建设、域名、网络空间、网站托管、服务器租用、企业网站设计、建华网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

android:password="true"

不知道是不是你说的这种情况

希望能帮到你

编程。 安卓程序,点击登录按钮,判断password的密码是否正确,正确调用另一个窗体,错误显示错

bn.setOnClickListener(new OnClickListener() {// bn是登录按钮的监听器

if (password.getText().toString().equals("123")) {

Intent intent = new Intent(a.this, b.class);// a是本Activity,b是要跳转的Activity,b要在manifest.xml文件中声明

startActivity(intent);

} else {

TextView.setText("密码不正确!");

}

});

用java写一个手机商城注册界面代码

这篇文章主要介绍了java通过JFrame做一个登录系统的界面完整代码示例,具有一定借鉴价值,需要的朋友可以参考下。

在java的JFrame内通过创建匿名对象的方式做登录界面

package com.sxt;

import java.awt.Container;

import java.awt.GridLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JLabel;

import javax.swing.JPasswordField;

import javax.swing.JTextField;

public class LoginFrame extends JFrame{

JTextField txtname=new JTextField();

JPasswordField txtpass=new JPasswordField();

JButton bl=new JButton("登录");

JButton bg=new JButton("关闭");

//构造无参构造器把主要的方法放在构造器里,然后在main方法里面调

public LoginFrame(){

setBounds(25,25,250,250);

Container c = getContentPane();

c.setLayout(new GridLayout(4,2,10,10));

c.add(new JLabel("用户名"));

c.add(txtname);

c.add(new JLabel("密码"));

c.add(txtpass);

c.add(bl);

c.add(bg);

setDefaultCloseOperation(EXIT_ON_CLOSE);

setVisible(true);

//注意:此处是匿名内部类

bg.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e) {

// TODO Auto-generated method stub

System.exit(0);

}

}

);

//注意:此处是匿名内部类

bl.addActionListener(new ActionListener(){

public void actionPerformed(ActionEvent e) {

android怎么做动态的登陆界面

设计android的登录界面的方法:

UI实现的代码如下:

1、背景设置图片:

background_login.xml

?xml version="1.0" encoding="utf-8"?

shape xmlns:android=""  

gradient

android:startColor="#FFACDAE5"

android:endColor="#FF72CAE1"

android:angle="45"

/

/shape

2、圆角白框

效果图上面的并不是白框,其实框是白色的,只是设置了透明值,也是靠一个xml文件实现的。

background_login_div.xml

?xml version="1.0" encoding="UTF-8"?

shape xmlns:android=""  

solid android:color="#55FFFFFF" /

!-- 设置圆角

注意: bottomRightRadius是左下角而不是右下角  bottomLeftRadius右下角--

corners android:topLeftRadius="10dp" android:topRightRadius="10dp"

android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp"/

/shape

3、界面布局:

login.xml

?xml version="1.0" encoding="utf-8"?

LinearLayout

xmlns:android=""  

android:orientation="vertical"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="@drawable/background_login"

!-- padding 内边距   layout_margin 外边距

android:layout_alignParentTop 布局的位置是否处于顶部 --

RelativeLayout

android:id="@+id/login_div"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:padding="15dip"

android:layout_margin="15dip"

android:background="@drawable/background_login_div_bg" 

!-- 账号 --

TextView

android:id="@+id/login_user_input"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentTop="true"

android:layout_marginTop="5dp"

android:text="@string/login_label_username"

style="@style/normalText"/

EditText

android:id="@+id/username_edit"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:hint="@string/login_username_hint"

android:layout_below="@id/login_user_input"

android:singleLine="true"

android:inputType="text"/

!-- 密码 text --

TextView

android:id="@+id/login_password_input"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/username_edit"

android:layout_marginTop="3dp"

android:text="@string/login_label_password"

style="@style/normalText"/

EditText

android:id="@+id/password_edit"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_below="@id/login_password_input"

android:password="true"

android:singleLine="true"

android:inputType="textPassword" /

!-- 登录button --

Button

android:id="@+id/signin_button"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_below="@id/password_edit"

android:layout_alignRight="@id/password_edit"

android:text="@string/login_label_signin"

android:background="@drawable/blue_button" /

/RelativeLayout

RelativeLayout

android:layout_width="fill_parent"

android:layout_height="wrap_content" 

TextView  android:id="@+id/register_link"

android:text="@string/login_register_link"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginLeft="15dp"

android:textColor="#888"

android:textColorLink="#FF0066CC" /

ImageView android:id="@+id/miniTwitter_logo"

android:src="@drawable/cat"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentRight="true"

android:layout_alignParentBottom="true"

android:layout_marginRight="25dp"

android:layout_marginLeft="10dp"

android:layout_marginBottom="25dp" /

ImageView android:src="@drawable/logo"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_toLeftOf="@id/miniTwitter_logo"

android:layout_alignBottom="@id/miniTwitter_logo"

android:paddingBottom="8dp"/

/RelativeLayout

/LinearLayout

4、java源代码,Java源文件比较简单,只是实例化Activity,去掉标题栏。

package com.mytwitter.acitivity;

import android.app.Activity;

import android.os.Bundle;

import android.view.Window;

public class LoginActivity extends Activity {

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

requestWindowFeature(Window.FEATURE_NO_TITLE);

setContentView(R.layout.login);

}

}

5、实现效果如下:

安卓如何实现网页无痕浏览java代码?

下面是java执行代码。使用谷歌模拟手机,进行浏览网页。运行时注意chromedriver.exe的安装路径。

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import java.util.HashMap;

public class temp {

public static void main(String[] args) {

System.setProperty("webdriver.chrome.driver", ".\\drivers\\chromedriver.exe");

String URL = "";

HashMapString,String mobileEmulation = new HashMapString,String();

mobileEmulation.put("deviceName","iPhone X");

ChromeOptions options = new ChromeOptions();

options.setExperimentalOption("mobileEmulation", mobileEmulation);

WebDriver driver = new ChromeDriver(options);

driver.get(URL); //进入目的链接

}

}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

python执行代码

from selenium import webdriver

mobileEmulation = {'deviceName': 'Apple iPhone 4'}

options = webdriver.ChromeOptions()

options.add_experimental_option(


分享标题:安卓登录页面java代码 登录界面java代码
当前网址:http://cdkjz.cn/article/docjscg.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220