可视化窗口是大部分游戏的常态,今天我们就来了解下如何编写进度条窗口,快跟小编一起看看吧。
一、在包右击new->other->WindowBuilder->JFrame->name叫Guithreadpackage guithread;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridLayout;
import javax.swing.JProgressBar;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class GuiThread extends JFrame
{
private JPanel contentPane;
/** * Launch the application. */
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
try
{
GuiThread frame = new GuiThread();