Most voted "jframe" questions
Jframe is the class of the javax.swing package that represents a window. Use this tag only for questions related to this component
Learn more…69 questions
Sort by count of
-
21
votes1
answer1341
viewsHow to remove the edges of a Jframe?
I’d like to remove the edges of a JFrame. I used setUndecorated(true), however it removes completely and I would like to leave only the title bar of the JFrame.…
-
7
votes1
answer658
viewsHow to generate Jlabel or Jtextfield at mouse click?
I wonder if there is a way to generate a JLabel or JTextField at the position where you click, on a JPanel or a JFrame. It is possible?…
-
6
votes1
answer156
views -
6
votes2
answers3795
viewsHow do I run a video inside Jframe?
I want to open a screen and contain a player to run the video that is attached to the project!
-
5
votes1
answer551
viewsHow can I create a 20-number Bet Card look in Jframe
It is a game where your bet will be competing to Sena, Quina and Quadra, so each bet can only have 6 numbers, I need the user to select 6 numbers from these 20 and then I take these 6 selected and…
-
5
votes1
answer42
viewsIn Java Swing, should I extend Jpanel and top-level containers like Jframe?
Has in the Soen but I was not satisfied with the answers, and temporarily I am not able to ask IF.. Top-level containers like the JFrame I guess there’s no need, but a JPanel kind of made to be an…
-
4
votes0
answers178
viewsProblem with Ubuntu window focus setting when using Java
I was making a program in which a circle is drawn on the screen and it is walking around the screen, using the classes JFrame to create the window, a thread to control the circle I insert on the…
-
4
votes1
answer1116
viewsChange title bar and window icon
I want to change the title bar icon of the Java window, as shown below: I’m going the method initComponents() and leaving as it is in the code below, but the line setIconImage(iconeTitulo); is left…
-
4
votes1
answer1031
viewsHow to maintain the screen ratio after being resized by the user?
I need to restrict a certain proportion of a Jframe so that the layout of what I want to display on it isn’t distorted, but I wouldn’t want to have to block resizing with setRezisable(). The minimum…
-
3
votes1
answer439
viewsJframe Paint method does not show the drawings on the screen
I overloaded the method paint and I’m using the Graphics2d class to try to make the drawings, but nothing is being drawn on the screen, I could see with the Debugger that the method is run…
-
3
votes2
answers797
viewsImplementation of Jmenubar in a Jframe
I’m having trouble trying to insert a component JMenuBar to my main frame. I don’t get any kind of problem when executing the code, but the options bar is not displayed in the program. What is…
-
3
votes1
answer1122
viewsHow to center the title of a Jframe?
I have a jFrame component and I want to center his title, would it be possible?…
-
3
votes1
answer314
viewsBy icon in Jframe
It would be possible to icons in the application executable through code?
-
3
votes0
answers382
viewsHow to change startup icon image of a . jar?
For example, exchange that cup of coffee for another icon.
-
3
votes1
answer1699
viewsUpdate a Jtable within a Jframe through another Jframe
I own a JFrame, where inside it has a JTable and a JButton (Change) that makes the call from another Jframe. In this other Jframe, a data change is made according to the row selected in the table…
-
2
votes1
answer551
viewsHow to get the color of a pixel on the screen in JAVA 2D game?
Was there any way How to get the color of a Pixel on the x and y coordinates of the screen I specify?
-
2
votes1
answer692
viewsjFrame frozen/locked when opening in a jTable
The idea is to click on the row of the table that is a jFrame1 and open another jFrame2 with the search of the information of the person based on RE, but when I click on it the code works but opens…
-
2
votes1
answer676
viewsHow to maintain the layout of the components created by Windowbuilder in eclipse after compilation?
I created a Jframe using the Eclipse Windowbuilder plugin. Spacing, sizes and patterns have been defined. However while compiling the project the patterns are lost. Below the 2 photos for…
-
2
votes2
answers2363
viewsClose all open jframes when opening a new one
How can I close all jframes opened in my project when I run an action that opens another jframe? I have a login system and when necessary, I invoke another frame to define a password. After setting…
-
2
votes2
answers801
viewsConfirm form closure
I need to ask if I want to close the window that is open. I made the following form, but in any of the options, it closes. I currently use this event option: private void…
-
2
votes1
answer450
viewsHide tab - Java
I have a program with several tabs, so I will be if the user is ADMIN, based on this I would like to hide/disable some tabs, I have already tested these commands and do not disable the window:…
-
2
votes1
answer1025
viewsCalling an Arraylist from one Jframe to another
I need to call a ArrayList raised in a JFrame to another JFrame. In this case, the user would make a registration in one of the Jframes, called Registration, and from this would create the User…
-
2
votes1
answer51
viewsJframes Editing
I have the following code that corresponds to the Header Panel but does not give me the desired output that is in the image. Can anyone help me? public class PainelEstadoContacto extends JPanel{ /**…
-
2
votes1
answer1517
viewsCreate Jframe with label?
How to create a Jframe, containing a Jlabel with text, and can be positioned anywhere in the frame. I need this label to be anywhere in the frame area.…
-
2
votes1
answer88
viewsCreate Jlabel under image
I created a 672x750 Jpanel and put a 672x672 image inside it. I need to put texts under the image, in the space that remains. Is there any way to create a Jlabel and position it below the image? I…
-
1
votes2
answers4732
viewsHow to automatically adjust a Jframe to the screen size?
I have a program, and when I run on different computers, the window is all broken up and you can’t see the components you have in Jframe, I would like to know if there is any way that the window can…
-
1
votes0
answers68
viewsJava app application
This code when pressed on button definicoes, opens a new window with an image, a line with text and also generates radio Buttons, but the problem is that it creates another new window with radio…
-
1
votes1
answer933
viewsAlways focus on Jframe
I need that when I click on some button of my application the focus returns to the JFrame. Is there any method for this? I could call the method MeuFrame.requestFocus() in each ActionPerformed, but…
-
1
votes1
answer586
viewsMultiple buttons (Jbutton) with the same function in different Jpanels
I’m making a program (using the Netbeans GUI Builder and Cardlayout) with multiple screens (multiple Jpanels) and they’ll all have a start button, which obviously goes back to the home screen. I…
-
1
votes1
answer764
viewsHow do I initialize the centralized Jframe?
I’ve tried the this.setLocationRelativeTo(null); only he wasn’t in the middle of the screen, I’d say he was much more right and down than in the center. public Principal() {…
-
1
votes2
answers128
viewsJava: Connection Class Error
How to fix this error ? This is preventing you from connecting to the bank.... private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // Eventoos do Botao inserir try { //Registra…
-
1
votes1
answer157
viewsJframe opening repeatedly twice
I’m new to desktop programming, well, I’m making a program in java using swing and sqlite database, I’ve already made some things work, but after login the jframe that should open a single view…
-
1
votes1
answer148
viewsPick up Frame already started from the "Event Dispatch Thread"
I have a desktop application on swing, and in it, I have a single JFrame which is always visible while the application is open. There are also some JDialogs modals dependent on this Frame, which…
-
1
votes1
answer661
viewsClose window by clicking Jbutton
It is possible by clicking a button and the JFrame be closed as if you had clicked on the window X? If possible, how do I create it? From what I’ve studied is using ActionListener but I can’t find…
-
1
votes1
answer661
viewsHow to change border color and Jframe title in Java?
I would like to know how to change the border and title color of a Java Jframe. I only found information on how to remove the border and title, but how to change the color not. I am currently using…
-
1
votes1
answer87
viewsMain method in Jframe?
I have a question: When creating a new Jframe in Netbeans, a main method is placed inside it, I thought it was necessary and therefore never touched it. Today I deleted it and the program continued…
-
1
votes1
answer1315
viewsHow to make a Jframe return an instance of a given object?
I have a JFrame called Jframecadastre person which has only two fields name and surname, as shown in the image : Jframecadastre person: public class JFrameCadastroPessoa extends javax.swing.JFrame {…
-
1
votes1
answer933
viewsHow do I add a background image to a Jframe?
I’m trying to change the background image of my Jframe, but I’m having a hard time. Here’s the code: public class teste_tamagotchi extends JFrame { private JPanel contentPane; /** * Launch the…
-
1
votes2
answers852
viewsHow to Throw the dice of a Jlist into another Jlist that is in another Jframe?
I tried it in various ways, but I couldn’t find a solution. When I click the save button. I want him to throw the dice on that Jlist to the other Jlist that’s in the Other Jframe. "I couldn’t…
-
1
votes1
answer136
viewsCapture action of certain buttons in a Jframe
I created a JFrame that by clicking the keyboard buttons: up, down, left and right, there should be a certain action (a Joption in the case). That’s why I’m wearing one KeyListener, but…
-
1
votes1
answer190
viewsClose System after Dialog Close
How can I make a login screen when it is closed, also close the whole system? In the code below I have a main screen with the button "change user", when clicking, the system opens a Dialog for the…
-
0
votes1
answer1481
viewsHow do I get foreign key values on a Jframe form
I am creating a form in Jframe to insert data into a table that contains two foreign keys (since these keys are not generated automatically). What I have to put on Insert to get foreign keys? public…
-
0
votes2
answers671
viewsIn java, how to make only one Jframe window close when clicking on the x instead of all?
I’m making a program in Java with multiple windows JFrame, and wanted that when I pressed the x of one of the windows only this one closed, instead of all of them.
-
0
votes1
answer1665
viewsPrint Arraylist, Java Swing
I am starting my studies in Java applications with Swing, and I have doubts about how to print my Arraylist. How best to print or list an Arraylist within a window? In my case we have an agenda, we…
-
0
votes1
answer435
viewsHow to minimize Main Frame when opening a new frame
I have a little problem, I created an application in java with a menu that calls several screens. When opening some screen, I wanted my application main screen to be minimized. I tried with…
-
0
votes0
answers155
viewsInternal frame adjustable
I made a simple code in netbeans from an internalframe that loads inside the jframe, but the internalframe is a fixed size. If I open it with a full screen…
-
0
votes1
answer92
viewsAdd Background to a Girdbaglayout
Good afternoon guys, I’m struggling here trying to add a background image inside a Gridbaglayout but I can’t. Some charitable soul could help me? Follows Code > package View; import…
-
0
votes1
answer234
viewsHow to open a Jframe passed as parameter?
My idea is to open this window passed as parameter without it losing any attribute, for example, I have the class : public class Teste { JFrame janela = new JFrame; public…
-
0
votes0
answers106
viewsWhat’s the UPDATE error? (Java with Database)
Hello, I am developing for the first time a system in Java with Database and there is some error in the Update that since yesterday I look for and not found. The error is that when I click to…
-
0
votes1
answer37
viewsI need to modify the action taken when closing a Jframe
I am developing an application with persistence in Java for a college job, and I need the system to automatically save the data when closing the application (with a ready function provided by the…