- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不太确定我在这里做错了什么。该程序显示在线餐厅订购菜单。我还没有写出事件处理程序,但是我希望能够看看我是否做就是为程序工作。我将添加组件放入名为 initComponents() 的方法中但是我似乎无法在 main 方法中调用它。
这是完整的代码:
import javax.swing.*;
import javax.swing.JFrame;
import java.awt.*;
public class JameSimpsonP7 extends javax.swing.JPanel {
public static void main(String[] args){
//Declare Food Objects
//Appitizers
Food artDuo = new Food("Artichoke Duo", 11.00, "A duo of fried artichoke hearts and cream cheese artichoke dip. Served with Ciabatta crisps. ");
Food shrimpCocktail = new Food("Jumbo Shrimp Cocktail", 12.00, "Large ice cold shrimp served in a martini glass served with our house marinara sauce ");
Food sliders = new Food("Kobe Sliders", 11.00, "Three bite sized kobe beef hamburgers served with french fries and house dill aioli.");
Food crabStack = new Food("Mango Crab Stack", 13.00, "A tower of mango, cream cheese, and freash crab served with ciabatta crisps.");
Food bisque = new Food("Tomato Bisque", 6.00, "A bowl of our famous house tomato bisque served with house made croutons.");
//Entree's
Food ribeye = new Food("Ribeye", 38.00, "Our succulent ribeye cut cooked to order. Served with a loaded baked potato and lobster mac and cheese.");
Food surfTurf = new Food("Surf and Turf", 42.00, "A combination of our house prime rib cut and lobster cooked to order. Served with yorkshire pudding.");
Food filet = new Food("Filet Mignon", 34.00, "Our house cut of filet mignon served with au jous and bacon and asperigus creamed corn.");
Food nyStrip = new Food("New York Strip", 35.00, "A 12 oz. New York Cut steak strip cooked to your specification. Served with yorkshire pudding.");
Food primeRib = new Food("Prime Rib", 29.00, "A 14 oz. cut of our prime rib. Cooked to your specification. Served with house potatoes.");
Food charShirmp = new Food("Charbroiled Shrimp", 28.00, "Five of our large house shrimp grilled and served with a sweet corn polenta and asperagus.");
Food halibut = new Food("Pan Seared Halibut", 34.00, "Freash caught halibut grilled and served with house vegetables and yorkshire pudding.");
Food scallops = new Food("Ancho Peanut Dusted Scallops", 34.00, "Scallops seasoned with ancho peanut dust, grilled, and served with bacon and asperagus creamed corn.");
Food romanChick = new Food("Roman Chicken", 24.00, "A grilled airline chicken breast served with a melange of house vegetables and sweet corn polenta.");
Food salmon = new Food("Cedar Plank Salmon", 30.00, "Salmon smoked with our Cedar wood and lemon zest, served with a light pasta with a lemon caper buerre blanc sauce.");
//Sides
Food lobMacChz = new Food("Lobster Mac and Cheese", 8.00, "House made macoroni and cheese served with 4 oz. of pure lobster meat.");
Food yorkPud = new Food("Yorkshire Pudding", 5.00, "A smoky pudding made with our house french bread and a smokey caper and pepper sauce.");
Food crmCorn = new Food("Bacon and Asperegus Creamed Corn", 6.00, "A melange of bacon and asperegus with our house made creamed corn.");
Food potatoes = new Food("Parmesean House Chive Potatoes", 5.00, "Our house mashed potatoes made with chives and parmesean cheese.");
//Desserts
Food chocCake = new Food("Chocolate Cake", 7.00, "An individual dark chocolate cake served with chocolate shavings and a chocolate fudge sauce.");
Food carrotCake = new Food("Carrot Cake", 7.00, "Carrot cake with a cream cheese frosting and a sugar carrot on top.");
Food strawShrtCak = new Food("Strawberry Short Cake", 7.00, "An American Classic! Shortbread soaked with strawberry sauce, topped with whipped cream, and stuffed with strawberries.");
Food tiramisu = new Food("Tiramisu", 6.00, "A classic espresso and kahlua soaked lady finger cake served with chocolate shavings.");
Food applePie = new Food("Stuffed Apple Pie", 5.00, "Our applle pie dumpling served with cinnamon dust and whipped cream.");
Food bananaCrm = new Food("Banana Cream Pie", 6.00, "An individual pie crust stuffed with banana slices, vanilla pudding, and topped with a mirangue cream.");
JameSimpsonP7 frame = new JameSimpsonP7();
frame.initComponents();
}
public JameSimpsonP7() {
initComponents();
}
@SuppressWarnings("unchecked")
private void initComponents() {
northPanel = new javax.swing.JPanel();
titleLabel = new javax.swing.JLabel();
phoneNumLabel = new javax.swing.JLabel();
westPanel = new javax.swing.JPanel();
appitizerLabel = new javax.swing.JLabel();
appitizerPane = new javax.swing.JScrollPane();
appList = new javax.swing.JList();
entreeLabel = new javax.swing.JLabel();
entreePane = new javax.swing.JScrollPane();
entreeList = new javax.swing.JList();
dessertLabel = new javax.swing.JLabel();
dessertPane = new javax.swing.JScrollPane();
dessertList = new javax.swing.JList();
southPanel = new javax.swing.JPanel();
addToOrderButton = new javax.swing.JButton();
eastPanel = new javax.swing.JPanel();
yourOrderLabel = new javax.swing.JLabel();
orderTextArea = new java.awt.TextArea();
totalPanel = new javax.swing.JPanel();
delivaryCheckBox = new javax.swing.JCheckBox();
carryoutCheckBox = new javax.swing.JCheckBox();
subTotalLabel = new javax.swing.JLabel();
taxRateLabel = new javax.swing.JLabel();
totalPriceLabel = new javax.swing.JLabel();
calcButton = new javax.swing.JButton();
centerPanel = new javax.swing.JPanel();
detailPanel = new javax.swing.JPanel();
detailLabel = new javax.swing.JLabel();
detailTextArea = new java.awt.TextArea();
specificationPanel = new javax.swing.JPanel();
pricePanel = new javax.swing.JPanel();
priceLabel = new javax.swing.JLabel();
specificationLabel = new javax.swing.JLabel();
specificationField = new java.awt.TextField();
sidesPanel = new javax.swing.JPanel();
sideLabel = new javax.swing.JLabel();
buttonPanel = new javax.swing.JPanel();
lobMacChzRadioButton = new javax.swing.JRadioButton();
yorkPudRadioButton = new javax.swing.JRadioButton();
baconAspRadioButton = new javax.swing.JRadioButton();
parmPotRadioButton = new javax.swing.JRadioButton();
setMaximumSize(new java.awt.Dimension(800, 600));
setMinimumSize(new java.awt.Dimension(800, 600));
setLayout(new java.awt.BorderLayout());
northPanel.setBackground(new java.awt.Color(250, 0, 50));
northPanel.setLayout(new java.awt.BorderLayout());
titleLabel.setFont(new java.awt.Font("Trajan Pro", 1, 24)); // NOI18N
titleLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
titleLabel.setText("James American Bistro");
northPanel.add(titleLabel, java.awt.BorderLayout.CENTER);
phoneNumLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
phoneNumLabel.setText("(405) 555-3213");
northPanel.add(phoneNumLabel, java.awt.BorderLayout.PAGE_END);
add(northPanel, java.awt.BorderLayout.PAGE_START);
westPanel.setBackground(new java.awt.Color(255, 0, 50));
westPanel.setMaximumSize(new java.awt.Dimension(260, 520));
westPanel.setMinimumSize(new java.awt.Dimension(260, 520));
westPanel.setPreferredSize(new java.awt.Dimension(260, 520));
westPanel.setLayout(new java.awt.GridLayout(6, 1, 1, 1));
appitizerLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 14));
appitizerLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
appitizerLabel.setText("Appitizers");
westPanel.add(appitizerLabel);
appitizerPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
appList.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Artichoke Duo", "Kobe Sliders", "Jumbo Shrimp Cocktail", "Mango Crab Stack", "Tomato Bisque", "" };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
appList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
appList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
appListValueChanged(evt);
}
});
appitizerPane.setViewportView(appList);
westPanel.add(appitizerPane);
entreeLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 14));
entreeLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
entreeLabel.setText("Entrees");
westPanel.add(entreeLabel);
entreePane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
entreeList.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Ribeye", "Surf and Turf", "Filet Mignon", "New York Strip", "Prime Rib", "Charbroiled Shrimp", "Pan Seared Halibut", "Ancho Peanut Dusted Scallops", "Roman Chicken", "Cedar Plank Salmon", " ", " " };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
entreeList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
entreeList.setToolTipText("");
entreeList.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
entreeList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
entreeListValueChanged(evt);
}
});
entreePane.setViewportView(entreeList);
westPanel.add(entreePane);
dessertLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 14));
dessertLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
dessertLabel.setText("Deserts");
westPanel.add(dessertLabel);
dessertPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
dessertList.setModel(new javax.swing.AbstractListModel() {
String[] strings = { "Chocolate Cake", "Carrot Cake", "Strawberry Shortcake", "Tiramisu", "Stuffed Apple Pie", "Banana Cream Pie", " " };
public int getSize() { return strings.length; }
public Object getElementAt(int i) { return strings[i]; }
});
dessertList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
dessertList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
dessertListValueChanged(evt);
}
});
dessertPane.setViewportView(dessertList);
westPanel.add(dessertPane);
add(westPanel, java.awt.BorderLayout.LINE_START);
southPanel.setBackground(new java.awt.Color(255, 0, 55));
southPanel.setLayout(new java.awt.BorderLayout());
addToOrderButton.setText("Add to Order");
addToOrderButton.setToolTipText("");
addToOrderButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
addToOrderButton.setDoubleBuffered(true);
addToOrderButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
addToOrderButton.setMaximumSize(new java.awt.Dimension(10, 25));
addToOrderButton.setMinimumSize(new java.awt.Dimension(10, 25));
addToOrderButton.setPreferredSize(new java.awt.Dimension(10, 25));
addToOrderButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addToOrderButtonActionPerformed(evt);
}
});
southPanel.add(addToOrderButton, java.awt.BorderLayout.CENTER);
add(southPanel, java.awt.BorderLayout.PAGE_END);
eastPanel.setBackground(new java.awt.Color(255, 0, 50));
eastPanel.setMaximumSize(new java.awt.Dimension(260, 520));
eastPanel.setPreferredSize(new java.awt.Dimension(260, 520));
eastPanel.setLayout(new javax.swing.BoxLayout(eastPanel, javax.swing.BoxLayout.Y_AXIS));
yourOrderLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 14)); // NOI18N
yourOrderLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
yourOrderLabel.setLabelFor(orderTextArea);
yourOrderLabel.setText("Your Order");
eastPanel.add(yourOrderLabel);
orderTextArea.setEditable(false);
eastPanel.add(orderTextArea);
totalPanel.setBackground(new java.awt.Color(255, 0, 50));
totalPanel.setLayout(new java.awt.GridLayout(6, 1));
delivaryCheckBox.setBackground(new java.awt.Color(255, 0, 55));
delivaryCheckBox.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 11));
delivaryCheckBox.setText("Delivary - $4.00");
delivaryCheckBox.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
delivaryCheckBox.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
delivaryCheckBoxActionPerformed(evt);
}
});
totalPanel.add(delivaryCheckBox);
carryoutCheckBox.setBackground(new java.awt.Color(240, 0, 55));
carryoutCheckBox.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 11)); // NOI18N
carryoutCheckBox.setText("Carryout - Free!");
totalPanel.add(carryoutCheckBox);
subTotalLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 11));
subTotalLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
subTotalLabel.setText("Sub Total :");
totalPanel.add(subTotalLabel);
taxRateLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 11));
taxRateLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
taxRateLabel.setText("Tax Rate : ");
totalPanel.add(taxRateLabel);
totalPriceLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 11));
totalPriceLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
totalPriceLabel.setText("Total Price :");
totalPanel.add(totalPriceLabel);
calcButton.setBackground(new java.awt.Color(255, 0, 55));
calcButton.setText("Calculate");
calcButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
calcButtonActionPerformed(evt);
}
});
totalPanel.add(calcButton);
eastPanel.add(totalPanel);
add(eastPanel, java.awt.BorderLayout.LINE_END);
centerPanel.setBackground(new java.awt.Color(255, 255, 255));
centerPanel.setMaximumSize(new java.awt.Dimension(370, 520));
centerPanel.setPreferredSize(new java.awt.Dimension(370, 520));
centerPanel.setLayout(new java.awt.GridLayout(3, 1));
detailPanel.setBackground(new java.awt.Color(250, 250, 250));
detailPanel.setLayout(new java.awt.BorderLayout());
detailLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 11));
detailLabel.setText("Details");
detailPanel.add(detailLabel, java.awt.BorderLayout.LINE_START);
detailTextArea.setEditable(false);
detailPanel.add(detailTextArea, java.awt.BorderLayout.CENTER);
centerPanel.add(detailPanel);
specificationPanel.setBackground(new java.awt.Color(250, 250, 250));
specificationPanel.setLayout(new java.awt.GridLayout(4, 1));
pricePanel.setBackground(new java.awt.Color(250, 250, 250));
pricePanel.setLayout(new java.awt.BorderLayout());
priceLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 11));
priceLabel.setText("Price:");
pricePanel.add(priceLabel, java.awt.BorderLayout.LINE_START);
specificationPanel.add(pricePanel);
specificationLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 14));
specificationLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
specificationLabel.setText("Specifications");
specificationPanel.add(specificationLabel);
specificationField.setCursor(new java.awt.Cursor(java.awt.Cursor.TEXT_CURSOR));
specificationField.addTextListener(new java.awt.event.TextListener() {
public void textValueChanged(java.awt.event.TextEvent evt) {
specificationFieldTextValueChanged(evt);
}
});
specificationField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
specificationFieldActionPerformed(evt);
}
});
specificationPanel.add(specificationField);
specificationField.getAccessibleContext().setAccessibleDescription("");
centerPanel.add(specificationPanel);
sidesPanel.setBackground(new java.awt.Color(250, 250, 250));
sidesPanel.setLayout(new java.awt.BorderLayout());
sideLabel.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 1, 11));
sideLabel.setText("Add Sides");
sidesPanel.add(sideLabel, java.awt.BorderLayout.LINE_START);
buttonPanel.setBackground(new java.awt.Color(250, 250, 250));
lobMacChzRadioButton.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 11));
lobMacChzRadioButton.setText("Lobster Mac and Cheese - $8.00");
lobMacChzRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
lobMacChzRadioButtonActionPerformed(evt);
}
});
buttonPanel.add(lobMacChzRadioButton);
yorkPudRadioButton.setFont(new java.awt.Font("Tw Cen MT Condensed Extra Bold", 0, 11));
yorkPudRadioButton.setText("Yorkshire Pudding - $5.00");
yorkPudRadioButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
yorkPudRadioButtonActionPerformed(evt);
}
});
buttonPanel.add(yorkPudRadioButton);
baconAspRadioButton.setFont(new java.awt.Font(
"Tw Cen MT Condensed Extra Bold", 0, 11));
baconAspRadioButton.setText(
"Bacon and Asparagus Cream Corn - $6.00");
baconAspRadioButton.addActionListener(
new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
baconAspRadioButtonActionPerformed(evt);
}
});
buttonPanel.add(baconAspRadioButton);
parmPotRadioButton.setFont(new java.awt.Font(
"Tw Cen MT Condensed Extra Bold", 0, 11));
parmPotRadioButton.setText("Parmesean House Chive Potatoes - $5.00");
parmPotRadioButton.addActionListener(
new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
parmPotRadioButtonActionPerformed(evt);
}
});
buttonPanel.add(parmPotRadioButton);
sidesPanel.add(buttonPanel, java.awt.BorderLayout.CENTER);
centerPanel.add(sidesPanel);
add(centerPanel, java.awt.BorderLayout.CENTER);
}
//declare variables used in handlers
final double TAX_RATE = 2.9;
public double orderTotal;
public double [] yourOrderPrices = new double [10];
public String [] yourOrderName = new String [10];
public String details;
public double price;
//Handler Functions
private void calcButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void delivaryCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {
orderTotal += 4.00;
}
private void lobMacChzRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void specificationFieldActionPerformed(java.awt.event.ActionEvent evt) {
}
private void yorkPudRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void appListValueChanged(javax.swing.event.ListSelectionEvent evt) {
detailTextArea.setText("TEST");
}
private void dessertListValueChanged(javax.swing.event.ListSelectionEvent evt) {
detailTextArea.setText("TEST");
}
private void specificationFieldTextValueChanged(java.awt.event.TextEvent evt) {
}
private void addToOrderButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void baconAspRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void parmPotRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {
}
private void entreeListValueChanged(javax.swing.event.ListSelectionEvent evt) {
}
// GUI Componenet Declaration
private javax.swing.JButton addToOrderButton;
private javax.swing.JList appList;
private javax.swing.JLabel appitizerLabel;
private javax.swing.JScrollPane appitizerPane;
private javax.swing.JRadioButton baconAspRadioButton;
private javax.swing.JPanel buttonPanel;
private javax.swing.JButton calcButton;
private javax.swing.JCheckBox carryoutCheckBox;
private javax.swing.JPanel centerPanel;
private javax.swing.JCheckBox delivaryCheckBox;
private javax.swing.JLabel dessertLabel;
private javax.swing.JList dessertList;
private javax.swing.JScrollPane dessertPane;
private javax.swing.JLabel detailLabel;
private javax.swing.JPanel detailPanel;
private java.awt.TextArea detailTextArea;
private javax.swing.JPanel eastPanel;
private javax.swing.JLabel entreeLabel;
private javax.swing.JList entreeList;
private javax.swing.JScrollPane entreePane;
private javax.swing.JRadioButton lobMacChzRadioButton;
private javax.swing.JPanel northPanel;
private java.awt.TextArea orderTextArea;
private javax.swing.JRadioButton parmPotRadioButton;
private javax.swing.JLabel phoneNumLabel;
private javax.swing.JLabel priceLabel;
private javax.swing.JPanel pricePanel;
private javax.swing.JLabel sideLabel;
private javax.swing.JPanel sidesPanel;
private javax.swing.JPanel southPanel;
private java.awt.TextField specificationField;
private javax.swing.JLabel specificationLabel;
private javax.swing.JPanel specificationPanel;
private javax.swing.JLabel subTotalLabel;
private javax.swing.JLabel taxRateLabel;
private javax.swing.JLabel titleLabel;
private javax.swing.JPanel totalPanel;
private javax.swing.JLabel totalPriceLabel;
private javax.swing.JPanel westPanel;
private javax.swing.JRadioButton yorkPudRadioButton;
private javax.swing.JLabel yourOrderLabel;
//Food class handles food objects
private static class Food {
private String name;
private double price;
private String details;
public Food(String name, double price, String details) {
this.setName(name);
this.setPrice(price);
this.setDetails(details);
}
public String getName(){
return name;
}
public void setName(String name){
this.name = name;
}
public double getPrice(){
return price;
}
public void setPrice(double price){
this.price = price;
}
public String getDetails(){
return details;
}
public void setDetails(String details){
this.details = details;
}
}
}
最佳答案
您还没有创建任何可显示的窗口,例如可以在其中显示派生 JPanel
JameSimpsonP7
的 JFrame
。另外,调用 JameSimpsonP7
变量 frame
可能是您感到困惑的根源。
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JameSimpsonP7 panel = new JameSimpsonP7();
JFrame frame = new JFrame();
frame.add(panel);
frame.pack();
frame.setVisible(true);
}
});
关于java - 显示 GUI 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17867902/
关闭。这个问题是off-topic .它目前不接受答案。 想要改进这个问题? Update the question所以它是on-topic用于堆栈溢出。 关闭 12 年前。 Improve thi
我有一个动态网格,其中的数据功能需要正常工作,这样我才能逐步复制网格中的数据。假设在第 5 行中,我输入 10,则从第 6 行开始的后续行应从 11 开始读取,依此类推。 如果我转到空白的第一行并输入
我有一个关于我的按钮消失的问题 我已经把一个图像作为我的按钮 用这个函数动画 function example_animate(px) { $('#cont
我有一个具有 Facebook 连接和经典用户名/密码登录的网站。目前,如果用户单击 facebook_connect 按钮,系统即可运行。但是,我想将现有帐户链接到 facebook,因为用户可以选
我有一个正在为 iOS 开发的应用程序,该应用程序执行以下操作 加载和设置注释并启动核心定位和缩放到位置。 map 上有很多注释,从数据加载不会花很长时间,但将它们实际渲染到 map 上需要一段时间。
我被推荐使用 Heroku for Ruby on Rails 托管,到目前为止,我认为我真的会喜欢它。只是想知道是否有人可以帮助我找出问题所在。 我按照那里的说明在该网站上创建应用程序,创建并提交
我看过很多关于 SSL 错误的帖子和信息,我自己也偶然发现了一个。 我正在尝试使用 GlobalSign CA BE 证书通过 Android WebView 访问网页,但出现了不可信错误。 对于大多
我想开始使用 OpenGL 3+ 和 4,但我在使用 Glew 时遇到了问题。我试图将 glew32.lib 包含在附加依赖项中,并且我已将库和 .dll 移动到主文件夹中,因此不应该有任何路径问题。
我已经盯着这两个下载页面的源代码看了一段时间,但我似乎找不到问题。 我有两个下载页面,一个 javascript 可以工作,一个没有。 工作:http://justupload.it/v/lfd7不是
我一直在使用 jQuery,只是尝试在单击链接时替换文本字段以及隐藏/显示内容项。它似乎在 IE 中工作得很好,但我似乎无法让它在 FF 中工作。 我的 jQuery: $(function() {
我正在尝试为 NDK 编译套接字库,但出现以下两个错误: error: 'close' was not declared in this scope 和 error: 'min' is not a m
我正在使用 Selenium 浏览器自动化框架测试网站。在测试过程中,我切换到特定的框架,我们将其称为“frame_1”。后来,我在 Select 类中使用了 deselectAll() 方法。不久之
我正在尝试通过 Python 创建到 Heroku PostgreSQL 数据库的连接。我将 Windows10 与 Python 3.6.8 和 PostgreSQL 9.6 一起使用。 我从“ht
我有一个包含 2 列的数据框,我想根据两列之间的比较创建第三列。 所以逻辑是:第 1 列 val = 3,第 2 列 val = 4,因此新列值什么都没有 第 1 列 val = 3,第 2 列 va
我想知道如何调试 iphone 5 中的 css 问题。 我尝试使用 firelite 插件。但是从纵向旋转到横向时,火石占据了整个屏幕。 有没有其他方法可以调试 iphone 5 中的 css 问题
所以我有点难以理解为什么这不起作用。我正在尝试替换我正在处理的示例站点上的类别复选框。我试图让它做以下事情:未选中时以一种方式出现,悬停时以另一种方式出现(选中或未选中)选中时以第三种方式出现(而不是
Javascript CSS 问题: 我正在使用一个文本框来写入一个 div。我使用以下 javascript 获取文本框来执行此操作: function process_input(){
你好,我很难理解 P、NP 和多项式时间缩减的主题。我试过在网上搜索它并问过我的一些 friend ,但我没有得到任何好的答案。 我想问一个关于这个话题的一般性问题: 设 A,B 为 P 中的语言(或
你好,我一直在研究 https://leetcode.com/problems/2-keys-keyboard/并想到了这个动态规划问题。 您从空白页上的“A”开始,完成后得到一个数字 n,页面上应该
我正在使用 Cocoapods 和 KIF 在 Xcode 服务器上运行持续集成。我已经成功地为一个项目设置了它来报告每次提交。我现在正在使用第二个项目并收到错误: Bot Issue: warnin
我是一名优秀的程序员,十分优秀!