jcomponent
The JPanel contentpane confusion
I am learning Java Swing and I appended a menuBar to the frame. By default this should call jframe.getContentPane().add(child). When I ran the script the menuBar didn\'t show up. But the button was at[详细]
2023-04-13 08:59 分类:问答Reusing of components in Java not properly trimming un-reused ones
I have a javax.swing.JPanel called calcResPanel (using a java.awt.GridLayout with 1 column and indefinite (0) rows) which is to receive and display a set of BHSelectableLabels (which extend javax.swin[详细]
2023-04-13 01:53 分类:问答How to make a swing component's bounds fixed
I have a JPanel to which I have added a few components (checkbox, combo etc.). I have noticed that, when the frame is maximized, the bounds of components also move or shift to the right. Then, on rest[详细]
2023-04-11 18:16 分类:问答How can I resize and paintComponent inside a frame
Write a program that fills the window with a larrge ellipse. The ellipse shoud touch the window boundaries, even if the window is resized.[详细]
2023-04-09 10:15 分类:问答Create a margins editor component like the one in Microsoft word
I have a Java Swing application that i want to create a nice component in it like a component in Microsoft word. In Microsoft word you can change the margins of your document like in here :[详细]
2023-04-08 05:14 分类:问答How can I display a countdown timer in a JComponent?
I want to display a countdown timer (which is a JLabel) on the JComponent. I know the time开发者_如何学编程r works but the problem is I can\'t display it.[详细]
2023-04-06 03:53 分类:问答Simple custom Swing JComponent always flat
I\'m just playing with Swing and I\'m working on a really simple Swing component. I have a component inherited from JComponent class and its UI inherited from ComponentUI. The paint() method looks lik[详细]
2023-04-04 18:28 分类:问答Check whether a JPanel contains a JButton
I have added a button to a JPanel. I want to remove the button if the JPanel contains the button.Is ther开发者_如何学运维e any way to check whether the JPanel contains the button?If you have a referen[详细]
2023-04-02 18:10 分类:问答Dynamically add components without clicking button
I am adding the components dynamically at runtime on clicking the button. But now i want to add components Dynamically without clicking button.[详细]
2023-04-02 10:38 分类:问答How to make my JComponent conform to JFrame.pack and Layout Managers?
I made a JComponent that displays a rectangle of a specified color. (Haven\'t found any other way to achieve this effect). Problem is, it doesn\'t follow JFrame.pack() and Layout Managers as expected.[详细]
2023-04-01 03:27 分类:问答