jframe

Why is my JFrame just a black window?

余生颓废 提交于 2020-01-06 14:39:03
问题 My code is this, when I run it I just get a black window and I have no idea why. Thanks for any feedback. Its supposed to print out a picture, and eventually make it move. package assignment04; import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.JFrame; import javax.swing.JPanel; public class GoLDriver { public static void main(String[] args) { GoLModel model= new GoLModel(); JFrame frame = new JFrame(); JPanel panel= new JPanel(); panel.setLayout(new BorderLayout());

drawString prints string over a screenshot of my current window

浪尽此生 提交于 2020-01-06 12:58:35
问题 When I run this code in Eclipse I get a the string and line printing in a new windows, but instead of a blank window it simply is a screenshot of my current window, set to the size I declare. http://i.imgur.com/nWFN9YJ.png Any suggestions on what I'm doing wrong? import java.awt.Graphics; import javax.swing.JFrame; public class EmptyFrame2 extends JFrame { public static void main(String args[]) { EmptyFrame2 JF=new EmptyFrame2(); JF.setSize(1000,500); JF.setVisible(true); } public void paint

Is it possible make all JFrames the internal program uses into JInternalFrames and place them in a JDesktopPane?

大憨熊 提交于 2020-01-06 09:04:32
问题 The goal is to have the user select a java program, then my program opens up a JInternalFrame with a JEditorPane inside it as the console and places said JInternalFrame in a JDeskopPane . Is it possible to change all the Window s the user's program may open into JInternalFrame s and place them in said JDesktopPane , as well? (individual question from IDE-Style program running) 回答1: I'm quite sure that this would not be possible to do without tampering with the binaries of the program that you

Getting unexpected output from the swing program

我们两清 提交于 2020-01-06 09:03:29
问题 In the following code why i'm getting an invisible window?What does setUndecorated() do and where it is used for. import java.awt.Color; import java.awt.Dimension; import java.awt.Toolkit; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class UsingJLayer { UsingJLayer() { JFrame jfrm=new JFrame("Picasa Viewer"); jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension dim=Toolkit.getDefaultToolkit().getScreenSize(); jfrm.setSize(dim); jfrm.setUndecorated(true); jfrm

Is it possible make all JFrames the internal program uses into JInternalFrames and place them in a JDesktopPane?

六月ゝ 毕业季﹏ 提交于 2020-01-06 09:03:20
问题 The goal is to have the user select a java program, then my program opens up a JInternalFrame with a JEditorPane inside it as the console and places said JInternalFrame in a JDeskopPane . Is it possible to change all the Window s the user's program may open into JInternalFrame s and place them in said JDesktopPane , as well? (individual question from IDE-Style program running) 回答1: I'm quite sure that this would not be possible to do without tampering with the binaries of the program that you

Is it possible make all JFrames the internal program uses into JInternalFrames and place them in a JDesktopPane?

依然范特西╮ 提交于 2020-01-06 09:03:07
问题 The goal is to have the user select a java program, then my program opens up a JInternalFrame with a JEditorPane inside it as the console and places said JInternalFrame in a JDeskopPane . Is it possible to change all the Window s the user's program may open into JInternalFrame s and place them in said JDesktopPane , as well? (individual question from IDE-Style program running) 回答1: I'm quite sure that this would not be possible to do without tampering with the binaries of the program that you

Incompatible Java versions. Eclipse running under 0 [duplicate]

南笙酒味 提交于 2020-01-06 08:44:11
问题 This question already has answers here : Eclipse Oxygen : Incompatible java versions (2 answers) Closed last year . I wanted to create a JFrame (got all the Swing libraries needed) but this is what shows up on the design tab. I've been looking for similar problems but it only shows some other specific numbers , for example "Eclipse is running under 1.6" or "1.7" etc. But never have I seen "Eclipse running under 0" , what does this even mean? I uninstalled java and eclipse and re-installed

How to move 3 buttons inside a window

我的梦境 提交于 2020-01-06 07:26:14
问题 In the below code I am attempting to move the three buttons to the left when you click the left button. When I click it; nothing happens currently. Can anyone explain to me what I am doing wrong here? Also, for some reason it has stopped compiling correctly and I am unsure why but I BELIEVE it is because of a mistake in my code while attempting to get the buttons to move to the left when you click the button. I do NOT want the window to move. Just the buttons within the window. Does any one

Java Errors for simple program stop compiling process, please help

别说谁变了你拦得住时间么 提交于 2020-01-06 06:11:01
问题 I am a beginner here, but I have been dealing with this unknown issue for a while now. Please view this simple program that I have coded and explain why it will not compile for me. The thing is that I have copied this code from a teacher and it works fine on his machine. Then when I tried to run the example on my machine I get 13 errors! Here is the first class: import java.awt.*; import java.awt.event.*; import javax.swing.*; class radio extends JFrame{ private JTextField tf; private Font pf

Java Errors for simple program stop compiling process, please help

▼魔方 西西 提交于 2020-01-06 06:10:27
问题 I am a beginner here, but I have been dealing with this unknown issue for a while now. Please view this simple program that I have coded and explain why it will not compile for me. The thing is that I have copied this code from a teacher and it works fine on his machine. Then when I tried to run the example on my machine I get 13 errors! Here is the first class: import java.awt.*; import java.awt.event.*; import javax.swing.*; class radio extends JFrame{ private JTextField tf; private Font pf