Hi, I am practicing using inner classes but am having difficulty with a homework question: It is as follows:
Create a Swing component class BetterButtons that extends JPanel and has three Jbutton instances labelled "One", "Two", and "Three". In the constructor of BetterButtons, write a local class ButtonListener that implements Action...
I can set the title bar background when maximised using InternalFrame.activeTitleBackground and InternalFrame.inactiveTitleBackground but how do I set it when the internal frame is minimised?
...
I use Swing from JRuby and I am trying to set up a JTable with a TableModel as input.
table_headers looks something like this: ["bla", "narf", "poit"]
table_data looks something like this: [["one", "two"], ["test, test"], ["hello", "world"]]
my_model = javax.swing.table.DefaultTableModel.new(table_data,table_headers)
results in
...
Hi,
I hava a table in a scrollPane. There are 6 columns in my table. I want the last 2 columns to be wider than other columns. But after I set the size of the columns, the vertical scroll bar disappeared. If I comment out the code for resetting the columns width, everything goes back to normal. Could anyone tell me what's the problem o...
I'm trying to create a simple Java desktop application using the Swing Application Framework and the MVC model but I'm struggling on some areas because there is a lack of good examples (the only SAF examples I have found are anything but MVC!).
I manage to fire events from components, but apart from that I struggle to use the MVC model ...
I'm trying to follow the MVP (specifically Passive-View) pattern in a java swing ui application.
The basic design of the application reminds a wizard control. The screen is divided to two main parts:
an active view.
a static navigation bar, with navigation buttons.
The user can use buttons to change the active view, but the bar is ...
I have textpane getting generated. i need to supercript the text when the text is selected and during click of superscript button, i need to superscript the text. if the text is already superscripted, it needs to unsuperscript the text. My problem is i am able to superscript the text, but unable to restore back. I am checking for the is...
I am working on Swing, I want to know how to effectively do TDD for my GUI applications.
I have already done something using abbot and fest... but i still feel it is not effective, it
is like doing Functional testing only, if any one having good suggestions please post..
...
How do I get a JLabel displaying a HTML string to appear greyed out (which is the behaviour of JLabels that don't display HTML text)? Is there another way than actually changing the colour myself by modifying the foreground property?
JLabel label1 = new JLabel("Normal text");
JLabel label2 = new JLabel("<html>HTML <b>text</b>");
// Both...
hi, i am a totally new programmer here and i have something to ask, i have uploaded a picture
into my GUI which displays on a Label, but the label dimension is set only 100,100 while the
picture is much bigger so when i upload it into the label it expands , is there anyway to make it auto resize to the label size? below is the action li...
I'm creating a GUI in Java using the GridBagLayout. Is there any way for me to create a component group so that I can pass the reference to the group and have access to all of them?
I've considered creating a panel and grouping the components that way, but I was wondering if there was another way that makes use of the complexity of the...
I have a JPanel upon which I draw a number of custom-written JComponents using the usual 'paintComponent(Graphics g)' method. I use a JLayeredPane to control the display order of the custom components, as follows:
public Class MyPanel extends JPanel {
private JLayeredPane layeredPane = new JLayeredPane();
private JComponent com...
Hi guys,
I'm developing a small app, which would have Swing GUI. App is doing IO task in another thread, when that thread finishes GUI should be updated acordingly to reflect thread's operation result. Class running in a (worker, non-GUI) has object passed to it in contructor which would be used for updating GUI, so I don't need to put ...
My problem is this
I want to show a popup menu to a menu item in java, this i can easily achieve,
but when i am showing the popup menu the parent menu clears,
behaviour i want is parent menu also should be visible while showing popup menu
...
I want to create a "browse" button in swing in which when a user "browse" browse button he shold be able to select a location from his hard drive folders to save the file.This is a part of my interface design.how do i do it?
I want the path to be displayed onto the text box on the side of browse button.
...
I am running Gnome on OpenSuse. As a result, my system look and feel is GTK+, which has numerous ugly problems (see some of them here).
During development of my swing app, I can run the client from command line or IDE and specify VM parameter
-Dswing.systemlaf=com.sun.javax.swing.plaf.metal.CrossPlatformLookAndFeel
to make it loo...
Is there a comparable mechanism to the .NET "set DisplayMember" for the JListBox Swing component?
Overriding the toString() method is not sufficient because I also want to be able to change the display member at runtime.
I also looked into implementing my own ListCellRenderer, but found it not very convenient.
Ist there a easier or mo...
i am currently stucked on how to create a login algorithm which will login a user based on 2 HashMap objects namely Students and StaffMembers from a class DataStorage, i do not know after getting the texts input from LoginHandler() what do i do with them to compare it with my DataStorage .
/* Class DataStorage*/
public class DataStorag...
I have a JPanel that I want to use to contain 3 vertical components:
a JLabel
a JTextField
a JScrollPane
I want all 3 components to fill the JPanel's width. I want the JLabel and JTextField to use their normal heights and the JScrollPane to use the rest.
BoxLayout almost works, except it seems like the JTextField and JScrollPane sha...
How to manage two JRadioButtons in java so that only one of them can be selected at a time? Is there any method in java to take care of this or you need to build your own logic?
...