Most voted "awt" questions
AWT (Abstract Window Toolkit) is the original graphic Toolkit of the Java programming language. Currently, AWT is part of the JFC (Java Foundation Classes), the standard API for graphical user interface (GUI) in a Java program. If the question is not about "AWT", do not use this tag, even if you are using "AWT" in your project.
Learn more…26 questions
Sort by count of
-
8
votes2
answers1621
viewsDifference between AWT and Swing in component rendering
What are the main differences between the Swing and AWT interface construction libraries, regarding how to render the components of both and the performance?
-
8
votes1
answer808
viewsWhat is Event-Dispatching Thread (EDT) in graphical interfaces?
When learning to build graphical interfaces with swing/AWT, you hear a lot about the Event-Dispatching Thread (or EDT). Although I already have a certain coexistence with swing, I confess that I do…
-
7
votes1
answer525
viewsHow to determine if a point of a swing component is visible on the screen?
How do I determine if a certain point X within a swing component is visible on the user screen? For example, let’s assume that the JComponent To was added to a window B (normally, but not…
-
4
votes2
answers1986
viewsJAVA - Draw Polygons (triangles, pentagons)
I was wondering if anyone could help me, I’m doing a project where I have to draw various figures, between them triangles and pentagons, I’ve already got the rectangles working, rectangles: import…
-
3
votes2
answers1346
viewsCenter Swing Window
I wanted to know how to call a Secondary Window in Swing and leave it centered with the Main Window of the program. At the moment, when I call him appears in the upper left corner.
-
3
votes1
answer45
viewsHow to get the edge of the line drawn with Graphics in Java straight?
I made a program that traces lines on the screen, but the line is very deformed (image 2) in certain links. I wanted to know if there is a way to leave straight (image 1) the edge of the line in…
-
2
votes1
answer1392
viewsGet item value in focus on a Jlist?
I have a Jlist and would like to take the value of the item that is in focus on it, not want to capture this value with click or with some button, but rather just changing the focus(by clicking on…
-
2
votes2
answers119
viewsHow to get the type of component clicked?
The getSource() method returns the event source, there is some method that returns the event source type, whether it was a jlabel, or jbutton, something like?
-
2
votes1
answer99
viewsWhy is it that when I change the size of the window, the components are gone?
I built an application using windowbuilder eclipse. In it, when clicking with the mouse, a picture is drawn according to the last selected button. However, when I change the window size, all the…
-
1
votes1
answer70
viewsCan I create a full app without using swing?
I’m creating a system and a question has arisen! Can I create forms without using Swing, AWT or the basic libraries in Java? If I use another framework, I can set aside Swing, AWT etc? What better…
-
1
votes1
answer1159
viewsDraw lines in binary tree graphical representation
I’m trying to draw a binary tree using swing and awt in java. I can already show the knots of the tree but I’m not able to draw the lines of a parent knot to your children. I have the Node, Treegui,…
-
1
votes1
answer139
viewsException in thread "main" java.awt.Illegalcomponentstateexception: The frame is Decorated
Guys I came back, I started studying AWT I made a simple program that just opened a window with a green background, but I try to create an event to the program window close and is giving the title…
-
1
votes1
answer84
viewsHow to delete data from Jtable and insert it again?
Through a button that has Coo function update the table I want the data to be removed and then come back, my code until then this so: public class atualizando implements ActionListener { @Override…
-
1
votes0
answers11
viewsChanging Widht and Hight of a Java text using the Graphics Class
Hello, follow my question.: As the image below would like to play something like this in Java using the Graphics Class I want to be able to scale a text with the Drawstring method, I took a look at…
-
0
votes0
answers80
viewsPointer error in a table fill method
Apparently it is to be right, but when I run the following errors: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at bibl.PesquisaSimpl.preencheTabela(PesquisaSimpl.java:188)…
-
0
votes1
answer38
viewsDoubt about getSource() instanceof
Instanceof is a binary operator that tests whether an object is the subtype of a certain type. Ex: Object fonte = e.getSource(); if (fonte instanceof JButton){ ... } If getSource() returned…
-
0
votes1
answer279
viewsHow to draw an image with Canvas?
I have this code and I want to draw an image: public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs == null) { createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics();…
-
0
votes2
answers63
viewsWhy don’t my labels show up in the swing?
Can anyone help me? It’s a pretty rookie mistake because my Abels aren’t showing up in the swing? import javax.swing.*; public class first{ public static void main(String[] args){ JFrame f = new…
-
0
votes1
answer188
viewsDelete selection from a List
In my java class I created a form and in it I created a button that clears all fields. But I can’t get you to delete the selection of a list that I have in the form, it erases the textfield and…
-
0
votes1
answer544
viewsWhat’s the Actionlistener for?
I’m starting to study Java. Can someone explain to me, in detail, in the most complete and simple way possible, what good is the method actionListener java (da lib swing). 'Cause I’m having a little…
-
0
votes1
answer75
viewsWhy is it that when I put on the "Jcombobox" component of Swing, my show looks like this?
code I used import javax.swing.*; public class ComboBox extends JFrame{ JComboBox<String> combo = new JComboBox<String>(); public ComboBox(){ add(combo); combo.addItem("Brasil");…
-
0
votes1
answer160
viewsFormulario.java:28: error: cannot find Symbol Botaoaction action = new Botaoaction(t);
Ah, so I was creating a show with Swing, heunderlined text reads the name that the user puts, and then shows it to him, very simple thing, I’m still very new, but when I created the class…
-
0
votes1
answer287
viewsHow can I change the position of my Jbutton in Swing?
Hello, I’m a beginner and very layman in Java, I was creating a program, and in this program had a button, I wanted to know how I change some button of place in Swing, if someone can help me, I…
-
0
votes1
answer53
viewshow do I use Actionlisten? I need an example to better understand
Guys, in a previous question I had asked a question about actionListen, but I wanted to ask an example, could someone give me an example, I created this simple code q shows a Jbutton in Swing,…
-
-1
votes1
answer40
viewserror: ")" expected } <
Guys, I’m trying to make a program that by clicking the confirm button, open another Jframe, but keeps giving the error error: ")" expected } ^ and error "teladelogin.java:48: error: class,…
-
-2
votes1
answer55
viewsAre API Components in the aws package?
I have the following question. And yes, it contains "aws" instead of "awt", but I think the correct one would be "awt". Are API Components in aws package? I - Panel II - Label III - Windows IV -…