Java中的图形用户界面... [英] graphical user interface in java...

查看:72
本文介绍了Java中的图形用户界面...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[Q :(软件:netbeans7.1)在此程序中,如果我想在GUI设计中查看输出(如下所示),那么我应该如何进行..我应该使用(来自类别选项中的新文件)将获得)javaSwing窗体和JFrame窗体(在FileType中)?
我在哪里可以得到针对初学者的确切gui设计书,以便我可以下载并正确完成我的工作....] plz help

[Q: (software: netbeans7.1) In this program if i want to see the output(as shown below) in a GUI design then how should i proceed.. should i use (from new file in category option we will get )javaSwing Form and JFrame form (in FileType) ??
Where can i get the exact gui design for beginners book, so that i can download and do my work properly....] plz help

public class CharacterinaStringAfterreplacement {// class name declaration
    public static void main(String[] args) {// main program start here//
        String s1="H.R System Finance Marketing";// string declaration (original)
        String s2="Finance";// string that is to be replaced
        String s3="Monitoring";// string that is to be assigned in result//
        String s4=s1.replace(s2,s3);// method for replacement of s1 (original)//
        int n=s1.length();//before replacement// length method for calculating the number of character in the replacement string// 
        int m=s4.length();//after replacement//length method for calculating the number of character original string// 
        System.out.println("1. *After* replacement of this string we are getting number of character like this below :)");
        System.out.println(s1.replace(s2, s3));
        
        
        System.out.println("number of character is ="+s4.length());
        System.out.println("2. *Before* replacement of the string we had the following number of character of this string :) ");
        System.out.println(s1);
        System.out.println("number of character is ="+s1.length());
    }
}


输出:
运行:
1. **替换此字符串后,我们得到的字符数如下:)
人力资源系统监控营销
字符数= 31
2. *在*替换字符串之前,我们已将该字符串的字符数更改为以下数字:)
人力资源系统金融营销
字符数= 28
建立成功(总时间:0秒)


output:
run:
1. *After* replacement of this string we are getting number of character like this below :)
H.R System Monitoring Marketing
number of character is =31
2. *Before* replacement of the string we had the following number of character of this string :)
H.R System Finance Marketing
number of character is =28
BUILD SUCCESSFUL (total time: 0 seconds)

推荐答案

http://docs.oracle.com/javase/tutorial/ [^ ]


字符串替换-不错.我对作业进行了评分-原因就是如此.

String replacement - nice. I rated it homework - cause that''s what it is.

String s1="H.R System Finance Marketing";
String s2="Finance";
String s3="Monitoring"; 
String s4=s1.replace(s2,s3);



您不需要将字符串的长度保留在int变量中.只需即时询问String,这会更好,因为在其他任何地方都不需要长度.

对于GUI设计-是的,请坚持使用Swing作为开始.您正在使用Netbeans-那里应该有一个不错的WYSIWYG-Editor.



You don''t need to hold the length of the strings in int variables. Just ask the String on the fly, that is much better as the length is not needed anywhere else.

For the GUI design - yes, stick to Swing for the start. You are using Netbeans - there should be a pretty good WYSIWYG-Editor in there.


这篇关于Java中的图形用户界面...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆