netbeans的编写图形界面操作。
来源:互联网 发布:带网络变压器的rj45 编辑:程序博客网 时间:2024/06/07 06:03
netbeans是sun公司的产品,特别好用,特别是代码补全和代码自动缩进,还有代码使用实例查找,引用等等,非常舒服。
相比较于eclipse,netbeans最最值得称道是他的图形系统编写。
不同于别的编译器用代码生成界面,netbeans提供直接拖拽操作实现界面从而生成代码,省去了手写代码的复杂。
netbeans的快捷方式。
可用的各种部件
设计是你设计的界面,源是根据你设计的界面生成的代码
e.g:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication2;
/**
*
* @author Administrator
*/
public class HelloWorld extends javax.swing.JFrame {
/**
* Creates new form HelloWorld
*/
public HelloWorld() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenu2 = new javax.swing.JMenu();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
jMenu2.setText("Edit");
jMenuBar1.add(jMenu2);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 279, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(HelloWorld.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(HelloWorld.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(HelloWorld.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(HelloWorld.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new HelloWorld().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenuBar jMenuBar1;
// End of variables declaration
}
- netbeans的编写图形界面操作。
- Netbeans中图形界面的引用
- 简易计算器Netbeans 图形界面
- 用netbeans编写的java简易计算器
- NetBeans 编写更改密码的方法
- 用QTDesigner编写Linux的图形界面程序
- 编写有图形界面的 Windows 服务程序
- 编写有图形界面的 Windows 服务程序
- 编写有图形界面的 Windows 服务程序
- 编写有图形界面的 Windows 服务程序
- 编写有图形界面的 Windows 服务程序
- 编写有图形界面的 Windows 服务程序
- Java图形界面编写的省市级联选项
- SVN的命令行操作、图形界面TortoiseSVN操作
- 关于NetBeans的界面风格转换详细操作
- Win32汇编教程八 图形界面的操作
- mySql图形界面操作的好东东
- 用Netbeans编写PHP
- DFS一个图并求出它的连通分支个数
- 一个研究生毕业后的职业规划
- OkHttp之post请求发送给服务器json
- Error:Execution failed for task ':app:mergeDebugResources'问题解决
- UIAlertView_带文本输入框的提示框
- netbeans的编写图形界面操作。
- Linux文件操作
- SimpleAdapter的使用介绍
- 机器算法实战中logistcal回归与SKlearn库算法对比
- 5.0 FIR数字滤波器引论
- 基于Xposed修改微信运动步数
- 实战Java高并发程序设计之ReadWriteLock
- Intent的学习小记
- 求逆序对 (用归并) nlogn