jframe

Clicking Past a Transparent Frame (Java)

本秂侑毒 提交于 2019-12-11 05:57:46
问题 I am trying to develop an application in Java (Swing) that lets me overlay a grid on the screen, and be able to click things behind the grid -- say, an icon the desktop for example. Would I approach this problem with a Transparent JFrame or a Transparent JWindow? Whatever I use, the transparent window/frame needs to always be on top. occupy the entire screen. register every click with a mouse listener. record the coordinates of the clicks on the screen. allow me to use the Graphics class to

How to make a JFrame blurred in java?

ε祈祈猫儿з 提交于 2019-12-11 05:51:14
问题 In my java program, when the user clicks on a button in the main JFrame another JFrame becomes visible on top of the main frame. Now how to make the previous frame blurred? Exactly like the background in the image : 回答1: Now how to make the previous frame blurred? have look at JLayer(Java7) based on JXLayer(Java6), similair effect is possible with GlassPane, or with JViewport (not proper of ways, but good Swing GUI contains JScrollPane as 1st. JComponent in JFrame / JDialog / JWindow ) 回答2: I

jFrame not opening correctly or showing contents

我的梦境 提交于 2019-12-11 05:47:53
问题 so I have a school project I need help on! So I am doing a 'task force schedule' app as my major project for this year (Grade 11, south africa) and I am stuck. I have an login system that logs into the database fine, then I have a "check in station" class called CheckIn which has a button that should open a table showing all the people working in a given station at that time if they are checked in. So far the table only pulls data from the database of everyone that is in the station,

Animation sequence in JFrame

感情迁移 提交于 2019-12-11 05:46:56
问题 I wanted to create a JFrame and put a sequence of images for animation in there. But the images don't appear in the frame window. I just want basic troubleshooting tips to make it appear in the window. Just edit the code for an answer if you can. My question: Why isn't the window displaying any pictures? It shows a window with a background color of blue, but that's it. Please tell me an efficient way to store images in variables and display it in a loop. import java.awt.*; import java.awt

Data from JTextField to JTable

独自空忆成欢 提交于 2019-12-11 05:39:44
问题 I would like to add the data entered in the text box to the table and keep on incremented ID. the data is added when the button "Add" is clicked. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class ex1 extends JFrame { GridLayout experimentLayout = new GridLayout(3, 3); private javax.swing.JButton jButton1,jButton2,jButton3; private javax.swing.JLabel jLabel1, jLabel2, jLabel3; private javax.swing.JTextField jTextField1,jTextField2,jTextField3; String columns[] = {

SetIconImage from Images in the resource

泄露秘密 提交于 2019-12-11 05:39:30
问题 I have A swing Application that has an Image Folder in the resources. I use the Following Piece of code to access the Images: btnDel = new JButton(new ImageIcon(getClass().getResource("/Recycling-Pool.png"))); This Methods Works fine For me in reference to Images for Components such as JLabels and JMenuItems. I have an Icon for the Application which I access using the Following Code: setIconImage(getToolkit().getImage("Images/Free bsd.gif")); This Also works fine for the Bar Icon, But I want

JFrame, Error Cannot make a static reference of the non-static field

怎甘沉沦 提交于 2019-12-11 05:38:38
问题 I am trying to set the data variable from SerialRead method but I got "Cannot make a static reference of the non-static field Etiqueta2", Eclipse said that I should make Etiqueta2 static but it doesnt show the data in the Jlabel. public class Final extends JFrame { //Crea Elementos de la interfaz JLabel Etiqueta=new JLabel(); JTextField Texto=new JTextField(); JButton Boton=new JButton(); JLabel Etiqueta1=new JLabel(); JLabel Etiqueta2=new JLabel(); JButton Boton1=new JButton(); public Final(

MidiSystem.getReceiver() freezes up JFrame

强颜欢笑 提交于 2019-12-11 05:31:52
问题 I'm making a program that involves playing MIDI sounds, and just today I encountered a problem where calling MidiSystem.getReceiver() or opening up a MidiDevice , totally prevents me from making a frame show up on the screen. And then if I try to terminate everything while everything is frozen up, Eclipse tells me that "terminate failed". Here's some sample code to show you what I mean: public static void main(String args[]) { Receiver receiver; try { receiver = MidiSystem.getReceiver(); }

Jframe JLabel, image refresh only if I resize the window

被刻印的时光 ゝ 提交于 2019-12-11 05:07:44
问题 I was trying to do a buffer to display it in a JLabel and use it in a JFrame . I have a problem when I change the image: the image changes only when I resize the window. package buffer; import java.awt.Color; import java.awt.event.KeyEvent; import java.awt.image.BufferedImage; import java.io.IOException; import java.net.URL; import javax.imageio.ImageIO; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JLabel; public class principal extends javax.swing.JFrame {

How I can selected by default an InternalFrame on a JDesktopPane?

风格不统一 提交于 2019-12-11 04:59:39
问题 I have a JFrame with the JDesktopPane and inside the JDesktopPane, I launch with the constructor a JInternalFrame. (Its a app like the authentification users, with the textbox user and textbox pass) I lauch the internal like this: MyInternalFrame internalF = new MyInternalFrame(); desktopPane.add(internalF); I try with: internalF.setVisible(true); internalF.setSelected(true); desktopPane.getDesktopManager().activateFrame(internal); desktopPane.setSelectedFrame(internal); How I can lauch the