Hi All,
I am fairly new in the domain of GUI designing and development. I do have some prior experience but that is with Visual Basic.
I would like to develop a reasonably comprehensive (though not state-of-the-art) GUI application on linux based on a command line app. that I have. Having done some googling, I do find that there a...
I am calling UIManager.getSystemLookAndFeelClassName().
And get as result WindowsLookAndFeel, even when setting current theme to WindowsClassicLookAndFeel. But I expect WindowsClassicLookAndFeel.
Question is how can I detect that windows classic theme is now active
...
Hi
I'm Riya a B.Tech. student and i have to make a corejava project on the topic COLLEGE MANAGEMENT SYSTEM . I have created the required database using MS Access. I m facing problem in a code which i m attaching here. Actually i want to update a data in the data base so i have made 2 frames in one of them Roll no. is asked when it is e...
When using a JTabbedPane, how do you indent the tabs?
Swing default output:
------- --------- ------
| A | | B | | C |
------------------------------
| |
| |
| |
| |
| |
Desired indented o...
How do you turn on and off a monitor from within a Java application?
In case you're wondering why, this is a kiosk style application where it would be great to turn off the monitors at night. Yes you can do it within the screensaver settings of the machine, but it would be great to do it programatically and avoid having to configure it ...
I have a dialog class with a constructor like the following
public SampleDialog(JComponent parent, String title){
super((Frame)SwingUtilities.getAncestorOfClass(Frame.class, parent), title, false);
setLocationRelativeTo(parent);
init();
}
However, this positions the dialog so that it's upper right hand corner is in the c...
Hello,
JFrame.setResizable(true) lets the user resize both the width and height of a window. Does a method exist which allows the user to ONLY resize the height?
Thanks.
Edit: The solutions below do NOT seem to work. On a 360x600 JFrame,
setResizable(true);
pack();
setMaximizedBounds(new java.awt.Rectangle(0, 0, 360, 1200));
setMaxi...
I need a JTextField that only accepts positive integers as input. My implementation mostly works. As you type text into the field, the digits appear and non-digits do not appear.
But there is a problem with the constructor's "text" argument. If I pass a String that contains the String representation of a positive integer, I would exp...
I have a buttonlistener that removes the TextFields and the StartButton when it is clicked, but the last part of the code that tells it to run a method that is supposed to display the icon is screwing up only at the end, but is still deleting the TextFields and the JButton. Please help.
public class TypeInNames extends JApplet{
JButt...
In my Swing app, I have a screen that has a bunch of JTextFields. Each JTextField uses an ActionListener's actionPerformed method to copy the user-entered text to my data model object.
This method seems to only be called if the user presses Enter. How can I copy the user-entered text to my data model object if the user doesn't press E...
I want to make a Java swing button 'not-focussable'.
The button should not receive focus at all, but should be able to receive mouse clicks.
I thought the following options, but these either dont solve my problem completely, or dont seem elegant. Are there any other/better/suggested options?
Move the focus to the next component immed...
If I get a bean and a dialog, and they are coupled with bidirectional data-binding, what is the best way to roll back to the original bean when user canceled the editing.
EDIT 1
If user opened up the dialog in edit mode, he then did some modification and pressed "OK", then this dialog closed and the underlying bean got updated. When I...
I know that data-binding sometimes can save lots of effort, but I'm not very clear on how to make decision that to use or not to use data-binding in various contexts.
...
I have a JFrame with a bunch of different JTextField and so on. How to collect data entered by user, without setting actions for each of this components?
Note: I create this JTextField using "inline" code, like this:
layout.row().grid(new JLabel("Density")).add(new JTextField("1"))
.spanRow();
layout.row().grid(new ...
I have created a jar file which throws the below error, Its a simple swing app which inserts a row whn i press a button, not sure where I am going wrong please advise.
private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setatmid(jTextField2.getText());
setaa10(Integer...
I have a JTable which is bound to my EventTracker bean, essentially a wrapper around a list which I will use as append/clear only (i.e., a simple log). Problem is, when I add entries to the list and try to fire an event I don't see any changes. I'm using the NetBeans IDE.
The EventTracker bean is added to the view and instantiated as ev...
The list of supported locales for "User Interface Translation" does not have all the languages I need to support. How can I add more languages for a JFileChooser?
...
I have been writing a database-centric Java Swing application for a while.
The GUI and DAO-code ends up in a big tree like:
JFrame
|
JTabbedPane
|
+--------------------+----------------------+-------------+
| | | |
JPanel1 JPanel2 JPanel3 ...
Hi I have a JFrame and there are two JPanels on top of it. My intention is to draw on the JPanels. Can anyone please share any Java code?
...
1) I was able to add a JTextField to the JFrame, and I initialized the class Java2sAutoTextField as given in Auto Complete JTextField (Swing / AWT / SWT / JFace forum at JavaRanch).
2) I initialized the list and field inside the JFrame constructor, as shown below.
List possible = new ArrayList();
possible.add("Austria");
possible.add...