Search Results

Search found 1571 results on 63 pages for 'swing'.

Page 5/63 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Swing verify code on event dispatch thread at runtime

    - by Jeff Storey
    Are there any libraries that instrument code to verify that methods called on swing components are called on the event dispatch thread? It probably wouldn't be too difficult to write some basic code for doing this, but I'm sure there are edge cases and whatnot that other people have handled. I'm looking for this at runtime though, not for unit tests. thanks, Jeff

    Read the article

  • Unselecting RadioButtons in Java Swing

    - by Thomas
    When displaying a group of JRadioButtons, initially none of them is selected (unless you programmatically enforce that). I would like to be able to put buttons back into that state even after the user already selected one, i.e., none of the buttons should be selected. However, using the usual suspects doesn't deliver the required effect: calling 'setSelected(false)' on each button doesn't work. Interestingly, it does work when the buttons are not put into a ButtonGroup - unfortunately, the latter is required for JRadioButtons to be mutually exclusive. Also, using the setSelected(ButtonModel, boolean) - method of javax.swing.ButtonGroup doesn't do what I want. I've put together a small program to demonstrate the effect: two radio buttons and a JButton. Clicking the JButton should unselect the radio buttons so that the window looks exactly as it does when it first pops up. import java.awt.Container; import java.awt.GridLayout; import java.awt.event.*; import javax.swing.*; /** * This class creates two radio buttons and a JButton. Initially, none * of the radio buttons is selected. Clicking on the JButton should * always return the radio buttons into that initial state, i.e., * should disable both radio buttons. */ public class RadioTest implements ActionListener { /* create two radio buttons and a group */ private JRadioButton button1 = new JRadioButton("button1"); private JRadioButton button2 = new JRadioButton("button2"); private ButtonGroup group = new ButtonGroup(); /* clicking this button should unselect both button1 and button2 */ private JButton unselectRadio = new JButton("Unselect radio buttons."); /* In the constructor, set up the group and event listening */ public RadioTest() { /* put the radio buttons in a group so they become mutually * exclusive -- without this, unselecting actually works! */ group.add(button1); group.add(button2); /* listen to clicks on 'unselectRadio' button */ unselectRadio.addActionListener(this); } /* called when 'unselectRadio' is clicked */ public void actionPerformed(ActionEvent e) { /* variant1: disable both buttons directly. * ...doesn't work */ button1.setSelected(false); button2.setSelected(false); /* variant2: disable the selection via the button group. * ...doesn't work either */ group.setSelected(group.getSelection(), false); } /* Test: create a JFrame which displays the two radio buttons and * the unselect-button */ public static void main(String[] args) { JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); RadioTest test = new RadioTest(); Container contentPane = frame.getContentPane(); contentPane.setLayout(new GridLayout(3,1)); contentPane.add(test.button1); contentPane.add(test.button2); contentPane.add(test.unselectRadio); frame.setSize(400, 400); frame.setVisible(true); } } Any ideas anyone? Thanks!

    Read the article

  • Java Swing for emulation

    - by Zachary
    I am planning to create a GUI for an emulation process using Java Swing. I would like to kindly ask if anyone could provide me some basic information about the technologies that I may need for the development of Java applications which handle emulation processes.

    Read the article

  • A simple two column layout with Swing

    - by Derk
    How to get a sidebar JPanel of a fixed with with Swing. Now I'm trying this: public SidebarPanel() { this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); this.setPreferredSize(new Dimension(200, this.getPreferredSize().height)); ... But when I resize the window also the width of the sidebar changes. How to fix this?

    Read the article

  • Task Manager Like App using Java Swing

    - by buddhika
    I want to how know how to set about writing a monitoring app such as Windows task manager using Java Swing. The main feature I am concerned with is the grid with a graph which get drawn with time. What are the features that I need to accomplish this? (e.g.: Java2D etc).

    Read the article

  • How to close a java swing application from the code

    - by hstoerr
    What is the proper way to terminate a Swing application from the code, and what are the pitfalls? I'd tried to close my application automatically after a timer fires. But just calling dispose() on the JFrame didn't do the trick - the window vanished but the application did not terminate. However when closing the window with the close button, the application does terminate. What should I do?

    Read the article

  • Creating an invisible button in Java Swing

    - by AniDev
    Hello, I have seen many times on Java Swing GUIs buttons that look like images until the mouse rolls over them. They appear to not have their content area filled. When the mouse rolls over them, the content area fills in but the button looks as though the mouse is not hovering over it. An example of this would be the toolbar of buttons used to activate each demo in SwingSet2. How is this effect possible? Thanks!

    Read the article

  • Swing UI does not have native OS look

    - by Virat Kadaru
    I am building an application in java swing and I am using the following code to give the UI a native OS look try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } On a OS X, the look is fine, but on windows (XP and 7) the buttons look like this. I have used this exact same code on other projects and it works fine. But in this particular project I get a completely different look. Thanks in advance!

    Read the article

  • Automatically connect to a DB in a swing application

    - by Oussama
    Hello, I m working on a single user swing application that access an hsqldb database. How can i Automatically run the DB server when a user run the application.? for example, after i finish development i will put the application into an exe file. If the exe file is distributed to multiple users. How can the DB server run and the DB be created when the user run the exe file? Thanks

    Read the article

  • Swing on OSX: How to Trap command-Q?

    - by yar
    After being convinced ("schooled") that Swing apps on Mac do look native, I'm trying to make mine look as native as possible. Everything looks great, but when I hit command-Q or do it from the menu, my windowStateChanged(WindowEvent e) is not firing on my main JFrame (if I exit in any other way, it does fire). How can I respond to the real Apple quit?

    Read the article

  • information need to display below in Form using Swing

    - by vamshikpd
    Hi All, I am using SunJavaStudio Enterprise 8 , using swing framework I created form,In form I added Jlable,JFormattedTextfield,Jpanle1,Jpanel2 and Jpanel3 in order wise.I am using GridBag layout.Above order displayed in form first line onwards, I want , In Form ,above will some gap and middle layer display the added fields . how to arrange the Form? Please help me,its urgent

    Read the article

  • Java Swing: JTextArea columns question

    - by battousai622
    How do i put the text in specific columns with jTextArea? private javax.swing.JTextArea jTextArea1; jTextArea1.setColumns(4); jTextArea1.insert(price, 0); //column 1 jTextArea1.insert(cost, 0); //column 2 jTextArea1.insert(quantity, 0); //column ect.. jTextArea1.insert(itemName, 0); jTextArea1.insert("\n", 0);

    Read the article

  • Cancel changes in a Java Swing Input window

    - by Tony
    I am new to Java Swing and I am creating a window which displays a list of items retrieved from an XML file that can be manipulated by the user. The window should have a Cancel and a Save functionality implemented with buttons. While the Save functionality is straightforward (just close the window) I don't know how to implement the Cancel functionality. Does exist an "undo" function? Does anyone know how?

    Read the article

  • Java Swing - good idea?

    - by Mike
    hi, simple question : I need to write cross platform application (basically CRUD). Is usage of Java Swing good idea? Or is it out-dated and you know better solution? I dont want to use like 5 languages for various stuff, one or two should be enough. Thanx!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >