菜单栏在Java中不显示
我用它的所有变量创建并定义了我的菜单栏,但它不会显示出来。它编译得很好,运行起来很容易,但菜单栏就是不在那里。。。我放错地方了吗? 仅供参考:菜单栏位于代码顶部附近,底部附近有一些复选框已添加到菜单栏中菜单栏在Java中不显示,java,swing,drop-down-menu,menu,Java,Swing,Drop Down Menu,Menu,我用它的所有变量创建并定义了我的菜单栏,但它不会显示出来。它编译得很好,运行起来很容易,但菜单栏就是不在那里。。。我放错地方了吗? 仅供参考:菜单栏位于代码顶部附近,底部附近有一些复选框已添加到菜单栏中 import javax.swing.*; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.Ac
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.util.Locale;
import json.JsonObject;
public class dicebot extends JFrame implements ActionListener {
static final long serialVersionUID = 1L;
private JPanel contentPane;
public static JCheckBox RollAmntCheck;
public static JTextField txtRollAmnt;
public static String APIKey = null;
public static JComboBox<String>cmbCurrency;
public static JMenuBar menuBar;
public static JMenu menu;
public static JMenuItem menuItem;
public static JButton btnLow;
public static JButton btnFloat;
public static JButton btnHigh;
public static JButton btnClearLog;
public static JButton btnDonate;
public static JButton btnCalc;
public static JCheckBox AlwaysOnTopCheck;
public static JCheckBox scrollCheck;
public static JCheckBox scrollDisable;
public static JTextField txtUserName;
public static JTextField txtStartBid;
public static JTextField txtMultiplier;
public static JTextField txtMinRemaining;
public static JPasswordField txtPassword;
public static JTextField txtOdds;
public static JTextField txtMaxBet;
public static JTextArea txtInfo;
public static JLabel lblBalTag;
public static JLabel userTag;
public static JLabel passTag;
public static dicebot frame = null;
public static void main(String[] args) {
Locale.setDefault(Locale.US);
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame = new dicebot();
frame.setVisible(true);
frame.setJMenuBar(menuBar);
Dicebotcode d = new Dicebotcode();
d.LoadSettings();
//d = null;
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public dicebot() {
setTitle("Dice Bot");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
JPanel panel = new JPanel();
contentPane.add(panel, BorderLayout.WEST);
GridBagLayout gbl_panel = new GridBagLayout();
gbl_panel.columnWidths = new int[]{0, 0};
gbl_panel.rowHeights = new int[]{0, 0};
gbl_panel.columnWeights = new double[]{0.0, 1.0};
gbl_panel.rowWeights = new double[]{0.0, Double.MIN_VALUE};
panel.setLayout(gbl_panel);
menuBar = new JMenuBar();
contentPane.add(menuBar);
menu = new JMenu("Options");
menu.getAccessibleContext().setAccessibleDescription("Menu Bar");
menuBar.add(menu);
menuItem = new JMenuItem("Menu");
menuItem.getAccessibleContext().setAccessibleDescription("Menu");
menu.add(menuItem);
//Every new Label however needs every part that says "user" or on the Password: "pass" changed to something unique.
userTag = new JLabel("Username:");
GridBagConstraints gbc_userTag = new GridBagConstraints();
gbc_userTag.insets = new Insets(0, 0, 0, 5);
gbc_userTag.anchor = GridBagConstraints.EAST;
gbc_userTag.gridx = 0;//Here are your x + y coords
gbc_userTag.gridy = 1;//Adding to x moves left, adding to y moves down
panel.add(userTag, gbc_userTag);
//Every new textfield needs only the * part to change for it to be valid. (gbc_* =)
//textField = new JTextField();
txtUserName = new JTextField();
GridBagConstraints grdUserName = new GridBagConstraints();
grdUserName.fill = GridBagConstraints.HORIZONTAL;
grdUserName.gridx = 1;
grdUserName.gridy = 1;
txtUserName.setColumns(10);
panel.add(txtUserName, grdUserName);
//panel.add(textField,txtUserName);
//textField.setColumns(10);
JLabel balTag = new JLabel("Current Balance:");
GridBagConstraints gbc_balTag = new GridBagConstraints();
gbc_balTag.insets = new Insets(0, 0, 0, 5);
gbc_balTag.anchor = GridBagConstraints.EAST;
gbc_balTag.gridx = 0;
gbc_balTag.gridy = 0;
panel.add(balTag, gbc_balTag);
lblBalTag = new JLabel("[________________]");
lblBalTag.setToolTipText("Balance as of the last call to the peerbet site.");
GridBagConstraints gbc_lblBalTag = new GridBagConstraints();
gbc_lblBalTag.insets = new Insets(0, 0, 0, 5);
gbc_lblBalTag.anchor = GridBagConstraints.EAST;
gbc_lblBalTag.gridx = 1;
gbc_lblBalTag.gridy = 0;
panel.add(lblBalTag, gbc_lblBalTag);
JLabel startTag = new JLabel("Starting Bid:");
GridBagConstraints gbc_startTag = new GridBagConstraints();
gbc_startTag.insets = new Insets(0, 0, 0, 5);
gbc_startTag.anchor = GridBagConstraints.EAST;
gbc_startTag.gridx = 0;
gbc_startTag.gridy = 3;
panel.add(startTag, gbc_startTag);
txtStartBid = new JTextField();
GridBagConstraints grdStartBid = new GridBagConstraints();
grdStartBid.fill = GridBagConstraints.HORIZONTAL;
grdStartBid.gridx = 1;
grdStartBid.gridy = 3;
txtStartBid.setText("0.00000010");
txtStartBid.setEnabled(false);
panel.add(txtStartBid, grdStartBid);
JLabel multTag = new JLabel("Multiplier:");
GridBagConstraints gbc_multTag = new GridBagConstraints();
gbc_multTag.insets = new Insets(0, 0, 0, 5);
gbc_multTag.anchor = GridBagConstraints.EAST;
gbc_multTag.gridx = 0;
gbc_multTag.gridy = 4;
panel.add(multTag, gbc_multTag);
txtMultiplier = new JTextField();
GridBagConstraints grdMultiplier = new GridBagConstraints();
grdMultiplier.fill = GridBagConstraints.HORIZONTAL;
grdMultiplier.gridx = 1;
grdMultiplier.gridy = 4;
txtMultiplier.setColumns(10);
txtMultiplier.setText("2");
txtMultiplier.setEnabled(false);
panel.add(txtMultiplier, grdMultiplier);
JLabel minTag = new JLabel("Min Remaining:");
GridBagConstraints gbc_minTag = new GridBagConstraints();
gbc_minTag.insets = new Insets(0, 0, 0, 5);
gbc_minTag.anchor = GridBagConstraints.EAST;
gbc_minTag.gridx = 0;
gbc_minTag.gridy = 5;
panel.add(minTag, gbc_minTag);
txtMinRemaining = new JTextField();
GridBagConstraints grdMinRemaining = new GridBagConstraints();
grdMinRemaining.fill = GridBagConstraints.HORIZONTAL;
grdMinRemaining.gridx = 1;
grdMinRemaining.gridy = 5;
txtMinRemaining.setColumns(10);
txtMinRemaining.setText("0");
txtMinRemaining.setEnabled(false);
panel.add(txtMinRemaining, grdMinRemaining);
txtPassword = new JPasswordField();
GridBagConstraints grdPassword = new GridBagConstraints();
grdPassword.fill = GridBagConstraints.HORIZONTAL;
grdPassword.gridx = 1;
grdPassword.gridy = 2;
txtPassword.setEchoChar('*');
txtPassword.setColumns(10);
panel.add(txtPassword, grdPassword);
passTag = new JLabel("Password:");
GridBagConstraints gbc_passTag = new GridBagConstraints();
gbc_passTag.insets = new Insets(0, 0, 0, 5);
gbc_passTag.anchor = GridBagConstraints.EAST;
gbc_passTag.gridx = 0;
gbc_passTag.gridy = 2;
panel.add(passTag, gbc_passTag);
txtOdds = new JTextField();
GridBagConstraints grdOdds = new GridBagConstraints();
grdOdds.fill = GridBagConstraints.HORIZONTAL;
grdOdds.gridx = 1;
grdOdds.gridy = 6;
txtOdds.setColumns(10);
txtOdds.addActionListener(this);
txtOdds.setText("49.5");
txtOdds.setEnabled(false);
panel.add(txtOdds, grdOdds);
JLabel oddsTag = new JLabel("Odds %:");
GridBagConstraints gbc_oddsTag = new GridBagConstraints();
gbc_oddsTag.insets = new Insets(0, 0, 0, 5);
gbc_oddsTag.anchor = GridBagConstraints.EAST;
gbc_oddsTag.gridx = 0;
gbc_oddsTag.gridy = 6;
panel.add(oddsTag, gbc_oddsTag);
txtMaxBet = new JTextField();
GridBagConstraints grdMaxBet = new GridBagConstraints();
grdMaxBet.fill = GridBagConstraints.HORIZONTAL;
grdMaxBet.gridx = 1;
grdMaxBet.gridy = 7;
txtMaxBet.setColumns(10);
txtMaxBet.setText("1");
txtMaxBet.setEnabled(false);
panel.add(txtMaxBet, grdMaxBet);
//This is the Combo Box
cmbCurrency = new JComboBox<String>(new String[]{"BTC","LTC","PPC","NMC","XPM","FTC","ANC","DOGE","NXT"});
GridBagConstraints gbc_list = new GridBagConstraints();
gbc_list.fill = GridBagConstraints.HORIZONTAL;
gbc_list.gridx = 1;
gbc_list.gridy = 9;
cmbCurrency.addActionListener(this);
cmbCurrency.setEnabled(false);
panel.add(cmbCurrency, gbc_list);
JLabel maxTag = new JLabel("MaxBet:");
GridBagConstraints gbc_maxTag = new GridBagConstraints();
gbc_maxTag.insets = new Insets(0, 0, 0, 5);
gbc_maxTag.anchor = GridBagConstraints.EAST;
gbc_maxTag.gridx = 0;
gbc_maxTag.gridy = 7;
panel.add(maxTag, gbc_maxTag);
JPanel panel_1 = new JPanel();
contentPane.add(panel_1, BorderLayout.SOUTH);
panel_1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
txtRollAmnt = new JTextField();
GridBagConstraints grdRollAmnt = new GridBagConstraints();
grdRollAmnt.fill = GridBagConstraints.HORIZONTAL;
grdRollAmnt.gridx = 1;
grdRollAmnt.gridy = 8;
txtRollAmnt.setColumns(10);
txtRollAmnt.setText("0");
//txtRollAmnt.setEnabled(false);
panel.add(txtRollAmnt, grdRollAmnt);
RollAmntCheck = new JCheckBox("Quit on win after:");
RollAmntCheck.setSelected(true);
GridBagConstraints grdRollAmntCheck = new GridBagConstraints();
grdRollAmntCheck.fill = GridBagConstraints.HORIZONTAL;
grdRollAmntCheck.gridx = 0;
grdRollAmntCheck.gridy = 8;
panel.add(RollAmntCheck, grdRollAmntCheck);
AlwaysOnTopCheck = new JCheckBox("Always On Top");
AlwaysOnTopCheck.setSelected(false);
AlwaysOnTopCheck.addActionListener(this);
GridBagConstraints grdAlwaysOnTopCheck = new GridBagConstraints();
grdAlwaysOnTopCheck.fill = GridBagConstraints.HORIZONTAL;
grdAlwaysOnTopCheck.gridx = 0;
grdAlwaysOnTopCheck.gridy = 9;
menu.add(AlwaysOnTopCheck, grdAlwaysOnTopCheck);
btnDonate = new JButton("Login");
btnDonate.addActionListener(this);
panel_1.add(btnDonate);
btnHigh = new JButton("Roll High");
btnHigh.addActionListener(this);
btnHigh.setEnabled(false);
panel_1.add(btnHigh);
btnLow = new JButton("Roll Low");
btnLow.addActionListener(this);
btnLow.setEnabled(false);
panel_1.add(btnLow);
btnFloat = new JButton("Roll Float");
btnFloat.addActionListener(this);
btnFloat.setEnabled(false);
btnFloat.setVisible(false);
panel_1.add(btnFloat);
btnClearLog = new JButton("Clear Log");
btnClearLog.addActionListener(this);
panel_1.add(btnClearLog);
btnCalc = new JButton("Max Loss Streak");
btnCalc.addActionListener(this);
btnCalc.setEnabled(false);
btnCalc.setVisible(true);
panel_1.add(btnCalc);
scrollCheck = new JCheckBox("Auto-Scroll");
scrollCheck.setSelected(true);
menu.add(scrollCheck);
scrollDisable = new JCheckBox("Disable Log");
scrollDisable.setSelected(false);
menu.add(scrollDisable);
btnCalc.setToolTipText("Click here to calculate the max loss streak you can handle based on current imputs.");
btnClearLog.setToolTipText("Click here to clear the log!");
btnHigh.setToolTipText("Click here to Roll High!");
btnLow.setToolTipText("Click here to Roll Low!");
btnFloat.setToolTipText("Click here to Roll?");
scrollCheck.setToolTipText("Toggles the auto-scroll function of the log.");
txtMaxBet.setToolTipText("The dicebot will not bet above amount entered in.");
txtOdds.setToolTipText("What odds(%) will the dicebot be rolling?");
txtPassword.setToolTipText("Enter your peerbet account password.");
AlwaysOnTopCheck.setToolTipText("Click to have the bot always appear above other windows");
txtMinRemaining.setToolTipText("The bot will stop when account has less than this amount in bank.");
txtMultiplier.setToolTipText("What shall the bet be multiplied by upon loss?");
txtStartBid.setToolTipText("What amount should the bot start each bet at?");
txtUserName.setToolTipText("Enter your peerbet account username.");
lblBalTag.setToolTipText("Current amount of chosen currency shown here.");
cmbCurrency.setToolTipText("Choose the currency that the bot will be using to roll with.");
txtRollAmnt.setToolTipText("Number of times to roll before stopping. 0 = Infinite");
RollAmntCheck.setToolTipText("Select to stop only after a win. Unselect to stop as soon as the # of rolls is reached");
JScrollPane scrollPane = new JScrollPane();// JScrollPane scrollPanel1 = new JScrollPane();//This will hold the information the bot sends over such as win/loose or error
contentPane.add(scrollPane, BorderLayout.CENTER);
txtInfo = new JTextArea("All number formats must use a period(.)\n");
txtInfo.setColumns(35);
txtInfo.setEnabled(false);
txtInfo.setDisabledTextColor(Color.black);
scrollPane.setViewportView(txtInfo);
pack();
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == cmbCurrency) {
if (cmbCurrency.getSelectedIndex() == 0){
txtStartBid.setText("0.00000010");
}else{
txtStartBid.setText("0.0001");
}
if(APIKey != null){
String balance = peerbetapi.get_balance(dicebot.APIKey);
JsonObject jsonObject = JsonObject.readFrom(balance);
if(jsonObject.get("status").asInt() == 1){
lblBalTag.setText(jsonObject.get("raffle_cur" + Integer.toString((cmbCurrency.getSelectedIndex() + 10))).asString());
}
}else{
lblBalTag.setText("[________________]");
}
}else if (e.getSource() == btnLow){
if(btnLow.getText() == "Roll Low"){
btnHigh.setText("Stop");
btnLow.setText("Stop On Win");
btnFloat.setEnabled(false);
Dicebotcode dbc = new Dicebotcode();
Dicebotcode.RollType = "low";
Dicebotcode.StopRollingOnWin = false;
Dicebotcode.StopRolling = false;
dbc.dbc();
}else{
// The EnableAllFields function will re-enable the buttons once its done.
btnLow.setText("Waiting...");
btnLow.setEnabled(false);
Dicebotcode.StopRollingOnWin = true;
}
}else if (e.getSource() == btnHigh){
if(btnHigh.getText() == "Roll High"){
btnHigh.setText("Stop");
btnLow.setText("Stop On Win");
btnFloat.setEnabled(false);
Dicebotcode dbc = new Dicebotcode();
Dicebotcode.RollType = "high";
Dicebotcode.StopRollingOnWin = false;
Dicebotcode.StopRolling = false;
dbc.dbc();
}else{
// The EnableAllFields function will re-enable the buttons once its done.
btnHigh.setText("Stopping...");
btnHigh.setEnabled(false);
btnLow.setEnabled(false);
Dicebotcode.StopRolling = true;
}
}else if (e.getSource() == btnFloat){
if(btnFloat.getText() == "Roll Float"){
btnHigh.setText("Stop");
btnLow.setText("Stop On Win");
btnFloat.setEnabled(false);
Dicebotcode dbc = new Dicebotcode();
Dicebotcode.RollType = "float";
Dicebotcode.StopRollingOnWin = false;
Dicebotcode.StopRolling = false;
dbc.dbc();
}else{
// The EnableAllFields function will re-enable the buttons once its done.
btnFloat.setText("Stopping...");
btnFloat.setEnabled(false);
Dicebotcode.StopRolling = true;
}
}else if (e.getSource() == btnClearLog){
txtInfo.setText("");
}else if (e.getSource() == btnDonate){
//donate d = new donate();
if(btnDonate.getText() == "Login"){
String reply = null;
try {
reply = peerbetapi.login(txtUserName.getText(), String.copyValueOf(txtPassword.getPassword()));
} catch (IOException e1) {
reply = "{\"status\":0, \"message\":\"An unknown error has occurred while attempting to login.\"}";
}
JsonObject json = JsonObject.readFrom(reply);
if(json.get("status").asInt() != 1){
txtInfo.append("Error: " + json.get("message").asString() + "\n");
txtInfo.setCaretPosition(txtInfo.getText().length());
}else{
APIKey = json.get("key").asString();
lblBalTag.setText(json.get("raffle_cur" + Integer.toString(cmbCurrency.getSelectedIndex() + 10)).asString());
btnDonate.setText("Donate");
userTag.setVisible(false);
txtUserName.setVisible(false);
passTag.setVisible(false);
txtPassword.setVisible(false);
txtStartBid.setEnabled(true);
txtMultiplier.setEnabled(true);
txtMinRemaining.setEnabled(true);
txtOdds.setEnabled(true);
txtMaxBet.setEnabled(true);
cmbCurrency.setEnabled(true);
btnHigh.setEnabled(true);
btnLow.setEnabled(true);
btnFloat.setEnabled(true);
txtInfo.append("Login successful!\n");
txtInfo.setCaretPosition(txtInfo.getText().length());
}
}else{
donate.showdonate();
}
}else if(e.getSource() == AlwaysOnTopCheck){
if(AlwaysOnTopCheck.isSelected() == true){
frame.setAlwaysOnTop(true);
}else{
frame.setAlwaysOnTop(false);
}
}
}
}
import javax.swing.*;
导入javax.swing.border.EmptyBorder;
导入java.awt.*;
导入java.awt.event.ActionEvent;
导入java.awt.event.ActionListener;
导入java.io.IOException;
导入java.util.Locale;
导入json.JsonObject;
公共类dicebot扩展JFrame实现ActionListener{
静态最终长SerialVersionId=1L;
私有JPanel内容窗格;
公共静态JCheckBox RollAmntCheck;
公共静态JTextField txtRollAmnt;
公共静态字符串APIKey=null;
公共静态JComboxCMB货币;
公共静态JMenuBar菜单栏;
公共静态菜单;
公共静态项菜单项;
公共静态按钮btnLow;
公共静态按钮btnFloat;
公共静态按钮btnHigh;
公共静态JButton btnClearLog;
公共静态JButton btnDonate;
公共静态按钮btnCalc;
公共静态JCheckBox始终进行TOPCHECK;
公共静态JCheckBox滚动检查;
公共静态JCheckBox滚动禁用;
公共静态JTextField txtUserName;
公共静态JTextField txtStartBid;
公共静态JTextField txtpimplier;
公共静态JTextField txtminreserving;
公共静态JPasswordField txtPassword;
公共静态JTextField;
公共静态JTextField txtMaxBet;
公共静态JTextArea txtInfo;
公共静态JLabel lblBalTag;
公共静态JLabel用户标签;
公共静态JLabel密码标签;
公共静态帧=空;
公共静态void main(字符串[]args){
setDefault(Locale.US);
invokeLater(新的Runnable(){
公开募捐{
试一试{
frame=new dicebot();
frame.setVisible(true);
frame.setJMenuBar(菜单栏);
Dicebotcode d=新的Dicebotcode();
d、 加载设置();
//d=零;
}捕获(例外e){
e、 printStackTrace();
}
}
});
}
公共机器人(){
SETTILE(“骰子机器人”);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
contentPane=newjpanel();
setboorder(新的EmptyBorder(5,5,5,5));
setLayout(新的BorderLayout(0,0));
setContentPane(contentPane);
JPanel面板=新的JPanel();
添加(面板,BorderLayout.WEST);
GridBagLayout gbl_面板=新建GridBagLayout();
gbl_panel.columnWidths=新的int[]{0,0};
gbl_panel.rowHeights=newint[]{0,0};
gbl_panel.columnWeights=新的双精度[]{0.0,1.0};
gbl_panel.rowWeights=新的double[]{0.0,double.MIN_值};
面板。设置布局(gbl_面板);
menuBar=newjmenubar();
contentPane.add(菜单栏);
菜单=新JMenu(“选项”);
menu.getAccessibleContext().setAccessibleDescription(“菜单栏”);
菜单栏。添加(菜单);
menuItem=新的JMenuItem(“菜单”);
menuItem.getAccessibleContext().setAccessibleDescription(“菜单”);
menu.add(menuItem);
//然而,每一个新标签都需要每一个写着“用户”或密码的部分,将“通行证”更改为独特的内容。
userTag=newjlabel(“用户名:”);
GridBagConstraints GBCU userTag=新的GridBagConstraints();
gbc_userTag.insets=新的insets(0,0,0,5);
gbc_userTag.anchor=gridbagstraints.EAST;
gbc_userTag.gridx=0;//这是您的x+y坐标
gbc_userTag.gridy=1;//添加到x向左移动,添加到y向下移动
panel.add(userTag,gbc_userTag);
//每个新的文本字段只需更改*部分即可生效。(gbc_*=)
//textField=新的JTextField();
txtUserName=新的JTextField();
GridBagConstraints grdUserName=新的GridBagConstraints();
grdUserName.fill=GridBagConstraints.HORIZONTAL;
grdUserName.gridx=1;
grdUserName.gridy=1;
txtUserName.setColumns(10);
面板添加(txtUserName、grdUserName);
//panel.add(textField,txtUserName);
//textField.setColumns(10);
JLabel balTag=新JLabel(“当前余额:”);
GridBagConstraints gbc_balTag=新的GridBagConstraints();
gbc_balTag.insets=新的insets(0,0,0,5);
gbc_balTag.anchor=GridBagConstraints.EAST;
gbc_balTag.gridx=0;
gbc_balTag.gridy=0;
面板。添加(balTag、gbc_balTag);
lblBalTag=新的JLabel(“[\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;
lblBalTag.setToolTipText(“上次调用peerbet站点时的余额”);
GridBagConstraints gbc_lblBalTag=新的GridBagConstraints();
GBClblbaltag.insets=新的插图(0,0,0,5);
GBClblbaltag.anchor=gridbagstraints.EAST;
gbc_lblBalTag.gridx=1;
gbc_lblBalTag.gridy=0;
面板.添加(lblBalTag,GBCLBLBALTag);
JLabel startTag=新JLabel(“起始出价:”);
GridBagConstraints gbc_startTag=新的GridBagConstraints();
gbc_startTag.insets=新的插入(0,0,0,5);
gbc_startTag.anchor=gridbagstraints.EAST;
gbc_startTag.gridx=0;
gbc_startTag.gridy=3;
面板添加(startTag、gbc_startTag);
txtStartBid=newjtextfield();
GridBagConstraints grdStartBid=新的GridBagConstraints();
grdStartBid.fill=GridBagConstraints.HORIZONTAL;
grdStartBid.gridx=1;
grdStartBid.gridy=3;
txtStartBid.setText(“0.00000010”);
txtStartBid.setEnabled(false);
面板添加(txtStartBid、grdStartBid);
JLabel multTag=新JLabel(“
frame.setJMenuBar(menuBar);
menuBar = new JMenuBar();
//contentPane.add(menuBar);
setJMenuBar(menuBar);
//menu.add(AlwaysOnTopCheck, grdAlwaysOnTopCheck);