jframe Questions

2

Solved

I am writing a java application that takes advantage of a dual monitor set up. I have two windows: Window 1 - Main GUI Window 2 - Full Screen on Second monitor My Problem: The second window onl...
Weathercock asked 11/7, 2014 at 18:29

9

I want to set the maximum length of a JTextField, so that you can't enter more characters than the limit. This is the code I have so far... textField = new JTextField(); textField.setBounds(40, ...
Wintergreen asked 13/4, 2012 at 7:22

1

I am making a top down 2d survival game where the player must dodge projectiles from enemies in order to survive, but I've run into an issue that may, slightly influence the gameplay of my first re...
Midian asked 15/1, 2021 at 11:56

6

Solved

We can use a list to initialise the window icons using Window.setIconImages(List<? extends Image>). What are the different sizes of icons typically used for in a JFrame? Code This code turns ...
Auklet asked 14/8, 2013 at 5:56

2

Solved

i'm new here. Hope you will be able to help. Problem: Problem with displaying Animation on JFrame. Seems I miss/don't understand enough how Java's graphics works. Global idea: Lets say I want mak...
Mongolism asked 28/6, 2013 at 21:29

2

Solved

The difference I see is (running on JDK 1.7): setVisible(false), invokes componentHidden but not windowClosed (The API states only on dispose() so it's OK even if it irritates me) but dispo...
Adynamia asked 12/1, 2016 at 12:25

8

Solved

I have in a JFrame some components that I want to refer into another JFrame and I want to get them by name and not do public get/set methods for each. Is there a way from Swing to get a component ...
Zaxis asked 10/2, 2011 at 14:54

2

Solved

How do you add a shadow to a undecorated jframe? From what I found online, you might be able to add the jframe to another black translucent window to give a shadow effect. Or somehow apply someth...
Waiter asked 30/9, 2013 at 22:52

1

I've discovered an issue with Windows 10 and Java. JFrame frame = new JFrame(); frame.setVisible(true); When I create a new JFrame and show it on the screen, it normally should have the screen c...
Bohunk asked 8/1, 2019 at 16:39

2

Solved

Does anyone know any way I can play an .mp4 video file in a JPanel? I have tried JMF with .avi file but found no success and now I'm baffled and frustrated at how such a simple task of playing a vi...
Entrenchment asked 27/8, 2018 at 12:5

5

Solved

I have a game of chess. I have written 3 classes. 1st if for game. (chessboard, pieces, and so on) And another one is for menu. (buttons like new, open, set time) Both of them use JFrame. I would...
Wareroom asked 25/6, 2013 at 0:21

4

Solved

I have a simple GUI: public class MyGUI extends JFrame{ public MyGUI(){ run(); } void run(){ setSize(100, 100); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// maybe ...
Patin asked 30/4, 2013 at 8:58

4

Solved

I want to display variations of the same image in the same JFrame, for example display an image in JFrame, then replace it with gray scale of the same image.
Leucas asked 26/10, 2009 at 19:8

3

Solved

I have a simple question. I have a project made with javax.swing.JFrame. I would like to iterate through all the objects that i Have added in the Jframe. Is that possible, how can I do it?
Hadden asked 22/4, 2012 at 19:4

5

Solved

I have a main JFrame that has all kinds of panels in it for different functions and people can calculate things in them. I want to open a new JFrame when the user hits the first calculate button an...
Dallapiccola asked 1/3, 2013 at 21:46

5

Solved

I have a JFrame with a Title. I want center align the title, so that it appears in the middle of the JFrame's title. Thanks.
Cystocarp asked 12/3, 2012 at 6:2

4

I have created a frame x1 which has a panel p1. When x1 is loaded, checkboxes are added dynamically to p1. The number of checkboxes added to p1 depend on the number of data values in the database t...
Chev asked 15/11, 2012 at 7:33

3

Solved

I would like to know how to get a transparent JFrame in the latest version of Java. Currently, you can only use <JFrame>.setOpacity(); if the frame is not decorated. I have no use for ...
Ventral asked 16/9, 2016 at 19:18

8

Solved

I have a JFrame and want to remove the maximize button from that. I wrote the code below, but it removed maximize, minimize, and close from my JFrame. JFrame frame = new JFrame(); frame.add(kart)...
Azotobacter asked 11/4, 2011 at 18:0

8

Solved

I don't get how can I employ this code: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); to close the program with the x button.
Overage asked 17/10, 2011 at 21:43

12

Solved

I have a dual monitor config and I want to run my GUI in a specific monitor if it is found. I tried to create my JFrame window passing a GraphicConfiguration object of my screen device, but it does...
Bookplate asked 7/1, 2011 at 16:13

3

Solved

I am an avid programmer but today is my first Java lesson. public void Paint (Graphics g) { if(g instanceof Graphics2D) { Graphics2D g2d = (Graphics2D)g; g2d.setRenderingHint(RenderingHints.KE...
Gynandrous asked 10/1, 2012 at 11:10

6

Solved

I just wrote a simple code where I want a textfield and a button to appear on the main frame, but after running all I see is the textfield. If I write the code of the button after the textfield th...
Oddfellow asked 28/12, 2011 at 20:12

5

Is there a way to set the insets of a JFrame? I tried frame.getContentPane().getInsets().set(10, 10, 10, 10); and frame.getInsets().set(10, 10, 10, 10); but none of them seem to work.
Weswesa asked 2/1, 2013 at 5:54

6

I want to replace a Jpanel with another one in a JFrame I already search and try my code but nothing's happen this is my code : public class Frame extends JFrame { private Container contain; p...
Hubbell asked 14/2, 2013 at 12:12

© 2022 - 2024 — McMap. All rights reserved.