Component « JFrame « Java Swing Q&A





1. Swing Component JFrame visibilty    stackoverflow.com

I have a swing component: a JFrame in fact. I noticed that when my code myframe.setVisible(flag); is executed it becomes invisible if flag is equal to false and visible otherwise. Does anybody know ...

2. Error in loading component property (Swing GUI Forms)    stackoverflow.com

For no apparent reason all my Swing GUI forms using components linked to org.jdesktop.beansbinding.Converter started generating errors when trying to open the Design View: Error Error in loading component property: [JPanel]->filterTextField->converter. Cannot load property ...

3. Can i add a component in jframe in netbeans at runtime?    stackoverflow.com

I am having a form built up in netbeans and want to add or remove a component with an actionperformed event of a button or a combobox is it possible? if ...

4. Building a GUI for a Sudoku Solver (Complete with ASCII Example)    stackoverflow.com

.

OVERVIEW, SAMPLE

Hello everyone, I have created a basic Sudoku solver that can solve most problems fairly quickly. I still have a lot of work ahead of me to make it solve even ...

5. Which Java text component should I be using to get it to resize to fit the frame as it is resized?    stackoverflow.com

I have a JTabbedPane and a JTextArea, I want the Textareas/Panes to resize to fit the window when the window is resized. How do I do this? I'm also fuzzy on ...

6. Correctly finding frame rate on a custom Java Component    stackoverflow.com

I am not confident my framerate code is correct, and I have not been able to find exact examples of what I am looking for. Essentially I have subclassed java.awt.Component, and ...

7. Components not displaying on JFrame time-to-time    stackoverflow.com

I have a JFrame Gridlayout with components like buttons, JTextfields, JLabels. Sometimes when I execute the file, I see an empty frame. So I have to maximize the screen, the components ...

8. reusing components in inherited Frame while maintaining GUI builder usage    stackoverflow.com

Hello
what is the best way to have JFrames, JDialogs, etc that derive from a common parent but differ some, to be able to have the common parts update automatically when the ...

9. Communication between frames, windows and components in Java Swing    stackoverflow.com

I have a Main app window (JFrame) with JPanel. On JPanel I have some buttons. After click one of buttons I create JDialog window where user can choose two options: "do ...





10. Problem with Netbeans IDE when putting swing components in a jFrame    stackoverflow.com

I`m making a GUI for my java program using Swing Components and Netbeans IDE. My problem is that I can't easily put the components on where ever I like in the ...

11. How to access a child object from parent component (JFrame)    stackoverflow.com

I have a top level container (JFrame) that contains two JPanels. One of the JPanel children has a property that will change and that needs to trigger an update on one ...

12. Is it bad form for view classes to listen and respond to their own components    stackoverflow.com

For simpl computations, is it alright or good to have a view listen and respond to its own components, or should a distinct controller handle ALL events, even ones like dispose() ...

13. Controlling components on in JFrame    stackoverflow.com

I am struggling controlling my components. I hava a JFrame which contains a JPanel. My components such as JLabel and JTextArea are added to this Panel. So my question is: How can ...

14. Reloading component Frame    stackoverflow.com

I'm Working on time schedule booking application , when I run the project it shows component(total frame) , however i want that when the button is pressed to reload ...

15. components don't show up when using JFrame    stackoverflow.com

I have a problem with JFrame and the key word "this". When I use frame.getContentPane, components don't show up unless I replace frame with "this". It seems getContentPane doesn't get the ...

16. In java, JFrame is Heavy Weight Component or Light Weight Component?    stackoverflow.com

I Know Swing is considered lightweight because it is fully implemented in Java, without calling the native operating system for drawing the graphical user interface components. On the other hand, AWT (Abstract ...





17. Can't see one component in a JFrame    stackoverflow.com

import java.awt.*;
import javax.swing.*;
import java.awt.geom.*;

public class Box {
    public static void main(String[] args){
        BoxFrame frame = new BoxFrame();
     ...

18. Clear components of JFrame and add new components    stackoverflow.com

I have a JFrame, which have some options. When OK button is pressed i want the same JFrame to clear the contents and add new contents. I have tried it but ...

19. Get specific JFrame component to change its value    stackoverflow.com

I have a JFrame called MainFrame where almost all of the components for my application are found. It has a JTabbedPane and lots of JPanels to group components. Now I have ...

20. JFrame Form and Palette Components are missing    forums.netbeans.org

My laptop crashed. Im working in a new one. I have copied my projects into the new laptop. Actual problems: - Reference Problem: The project uses a class library called "absolutelayout", ...

21. Error in loading component property (Swing GUI Forms)    forums.netbeans.org

christodupreez Joined: 19 Feb 2009 Posts: 2 Posted: Fri Mar 19, 2010 6:43 am Post subject: Error in loading component property (Swing GUI Forms) Yesterday for no apparent ...

22. How to reduce default spacing between components in GUI design window?    forums.netbeans.org

jaihind Joined: 19 Feb 2010 Posts: 13 Posted: Tue Jul 06, 2010 10:34 am Post subject: How to reduce default spacing between components in GUI design window? Hi, ...

23. Unable to use Design View to create GUI components for a JFrame    forums.netbeans.org

I'm new to NetBeans. Using V6.9 installed on MAC OS X10.6.4. I want to use the Swing GUI builder to design my forms. So I add a new file of type ...

24. How to add more components to a generated jFrame?    forums.netbeans.org

/** Creates new form jFrame1 */ public jFrame1() { initComponents(); jFrame1 jf1 = new jFrame1(); JButton newBtn = new JButton(); ...

25. D&D Component JFrame to JFrame    coderanch.com

26. how to control components of another window    coderanch.com

Hi, I have created two awt windows, window1 and window2. both window1 and window2 have TextAreas and control buttons and window1 has an menubar. when i click control buttons in window1 and window2 ,i am able to switch between windows. what i am trying to make is when i clicked the menubar in window1 i should be able to change the ...

27. Any way to know when frame/components ready for showing?    coderanch.com

I have an app that takes a bit to load the components before they can be shown. So I want to show a splash screen beforehand. The problem is I've been estimating how long it takes to load all the components, and showing the splash screen for that time. But of course, this time is different on every computer. Is there ...

29. Components aren't seen in Frame/JFrame    coderanch.com

30. JFrame doesn't display components at first    coderanch.com

Good day. I have an application to write and read a file. However, when the JFrame displays, it is SOMETIMES just an empty JFrame. If you resize it or move it, then the components (Some Checkboxes and a JButton) appear. I have no idea about what it could be. Could you please help me? import java.io.*; import javax.swing.*; import java.awt.*; import ...

31. How to know when a JFrame and its components are ready?    coderanch.com

I'm creating a browser, with the specific funcionality of search phrases in HTML files. Some files can be very large (10 mb of text - ONLY text). When I open the file, a status bar says: "Opening page: etc, etc, etc". When the reading was finished, it says: "Ready." But this happens when I OPEN the file. The problem is: The ...

32. How to make a component place on frame    coderanch.com

I have a program which fetches some data from database and shows it as a list on the Frame.When I click a button to fetch the data it works fine and displays the list populated with the data.But again when i click it works fine but a new list is created .I want to remove the earlier list and present the ...

33. Adding components to JFrame    coderanch.com

Hi all I'm using 1.5, so according to my course materials I don't need to create a Container in my class, or use getContentPane(). OK, but my book skims over what you do instead! I have a class that extends JFrame, with 3 panels full of stuff in there. After adding all the stuff, I go: add(displayPanel,BorderLayout.NORTH); add(keyPadPanel, BorderLayout.CENTER); add(functionPanel, BorderLayout.EAST); ...

35. what is the best way to write to an XML file from a swing form component    coderanch.com

I want to write to an xml file (xstream) using data input via a swing textfield. I have created the classes and the swing component and wrote some pseudo code for the addRecord() function which i want to write to the xml. Is this the best way of doing this, what have I missed. Sorry if this is too basic for ...

36. where is the frame and its components    coderanch.com

hi, i have the following code which has 3 Jlabels, 3 jtextfield and one jbutton. but when i run thre are no components present. import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; public class JDialogTest extends JFrame { private static final long serialVersionUID = 1L; JLabel label1 = new JLabel("User Name"); JLabel label2 = new JLabel("Password"); JLabel label3 = ...

37. components won't display unless window is resized    coderanch.com

I'm having a really weird problem with things being displayed on a JFrame. I was about to tear my hair out trying to get components to display on a JPanel that is sitting in a JFrame, but after I accidentally resized the window, everything showed up! After doing this several more times, I confirmed that my components were invisible until I ...

38. Swings newbee : Changing window components    coderanch.com

Can some one show me the code for a SIMPLE swing application window. were there are few components includign a button. Now on clicking the button i want to change the components on the window.I dont want old components i want new components. Lets take an example initially the window will have Component - 1: a non editable JTextPane with a ...

39. How to access parent JFrame component from its Child frame    coderanch.com

This is generic problem i come across every time but could not get any solutions Situation is When you have a Parent JFrame window and Several Child Frame inside the parent Window has toolbar and StatusBar How you handle the following requirements 1 - Based on logic of any child window how can i show a message in StatusBar which is ...

40. Read/Write of components of frame window    java-forums.org

Hi friends I am beginner to java and i have got one doubt while writing a program of frames. first i will tell what i need to do is 1.create a frame and 5 textfields to them,2 buttons. 2.write data in the textfield in execution. 3.when we click one of the button the data in the textfields should be copied into ...

41. Window needs to be re-sized to show components?    java-forums.org

Window needs to be re-sized to show components? I have built a program for my class assignment. There is one thing driving me nuts though: The form will not show any components unless it is re-sized. The funny thing is that you don't even need to re-size it at all; if you just put the mouse on the side ...

42. Need help with Image Component Frame    java-forums.org

I am trying to create a background or map on a frame. First I make a map class which is purpose of loading map from bunch of pictures. I have a Image 2D array under the map class that sort the image. Then I make a MapComponent class in order to draw Image. Last a MapViwer class to display frame. But ...

43. Get more components from JFrame Form.    java-forums.org

Get more components from JFrame Form. This is the first time I am trying to use the drag and drop with JFrame Form in Java. I am trying to make a GUI that are going to create new components when the user are clicking a button. In my GUI I have some labels and a lot of checkboxes. The ...

45. Access Child Components of JFrame?    java-forums.org

46. Components not displaying on JFrame    java-forums.org

my menu bar displays but my jpanel and the components in it are not displaying when i first compile the program. I have to compile it mutiple times to get it to display. i am using the setBounds method import javax.swing.*; import java.awt.event.*; import java.awt.*; public class IncomeTax extends JFrame { //Instance Variable Declaration private JMenuItem exit; private JMenuItem help; private ...

47. Resize a JFrame with components!    forums.oracle.com

Hy to all! I have a jframe with textfields, labels on it!It is possible to do that when I am resizing the frame for ex from 800x600 to 600x400 the components get resized??? I mean that they should get a lower size?? For ex if in the original window a textfield size is 100,25, after the resize to be a....... 70,15??? ...

48. Re: adding Canvas3d(awt component) to JFrame(swing)    forums.oracle.com

Hi I have asked this question before. But, then I had to add a Canvas to a JFrame. The suggestion was to use a JPanel instead of canvas. It worked wonderfully as there is not much difference between canvas and JPanel(at least as far as my application is concerned). Now I am trying to add Canvas3D to the JFrame. For some ...

49. Replacing components on JFrame    forums.oracle.com

50. Trouble Getting Any Display of JFrame Components    forums.oracle.com

I am looking and looking for getContentPane().add... somewhere and I'm not seeing it. Essentially you seem to create a number of components (buttons and such) add them to JPanels and then do nothing with the JPanels themselves. You also seem to have a great number of variables that are never used and that if else if block is somewhat nausea inducing. ...

51. Clearing GUI components displayed in a JFrame window    forums.oracle.com

Hi Programmers and Developers, Good day to y'all! My application displays a number of GUI components on the screen. I intend to design a JButton that can clear the window of all these GUI components when it is clicked. Is there a method that can erase already displayed GUI's or is their a technique i can implement to achieve this?? Many ...

52. Resize component in JFrame    forums.oracle.com

public ResizeComponent() { initComponents(); } // private void initComponents() { jPanel1 = new javax.swing.JPanel(); lbImage = new javax.swing.JLabel(); lbText = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Resize Component"); jPanel1.setLayout(null); jPanel1.setBackground(new java.awt.Color(0, 0, 0)); lbImage.setIcon(new javax.swing.ImageIcon("C:\\Users\\admin\\Desktop 117.jpg")); jPanel1.add(lbImage); lbImage.setBounds(10, 10, 200, 300); lbText.setFont(new java.awt.Font("Tahoma", 1, 34)); lbText.setForeground(new java.awt.Color(0, 0, 204)); lbText.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lbText.setText("Dian Sastro"); jPanel1.add(lbText); lbText.setBounds(10, 320, 200, 30); getContentPane().add(jPanel1, ...

53. Resizing a JFrame after components have been added or resized.    forums.oracle.com

In the future, Swing related questions should be posted in the Swing forum. I basically want the application to "re"-pack() itself Then all you need to do is invoke pack() on the frame once you you are finished adding/removing components. Of course I'm not sure this is the best design. As a user I don't really like seeing the frame shrinking ...

54. cannot remove components from JFrame    forums.oracle.com

55. Components added to JFrame not showing    forums.oracle.com

... What could be simpler than that? Not having to create the extra panel and define all the prefered and maximum and minimum sizes, that's what. If the user resizes the panel, java resizes all the components. The first time I tried it, I used GridLayout also, and it was ugly. Probably something simple and easy you would do in your ...

56. Changing a property of a swing component in a jframe from a different class    forums.oracle.com

Same as always - use a reference to the text field to invoke setText(). How you provide that reference is your problem, you know your app better than we do. You could alternatively set a name to the text field, and then get your frame's children, and iterate through them to find the field...

58. How to align a component within a JFrame?    forums.oracle.com