Search Results

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

Page 18/63 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Using AWT components inside a JInnerFrame (for JDesktopPane)

    - by Jack
    Hello, is there a way to hack bugs related to adding an AWT component (in my case a PApplet, so a processing language sketch) inside a JInternalFrame? It works but not as intended, since it flickers and dragging the frame causes repaint issues.. reading around it seems that, althrough it's possible to mix heavyweight (AWT) and lightweight (Swing) components some problems seem to be unavoidable.. is it true? Thanks!

    Read the article

  • StringBounds of htmlized string

    - by pavan
    Hi, Is it possible to calculate the bounds of a htmlized String in Java Swing? I tried using the BasicHtml.createHTMLView, but kept getting the same prefSpan; irrespective of the component font. Regards, Pavan

    Read the article

  • pop a frame

    - by somya agrawal
    I am working on a project (Java, Swing) in which i have to pop a frame on clicking a hyperlink. but the coding for the frame and all its components is done in a different class and that hyperlink exists in a different class. what shall i do to pop that frame on clicking of the hyperlink please tell. thanks.

    Read the article

  • Focused animation on custom JDialog

    - by n002213f
    If a JFrame has a JDialog modal open, the JDialog is animated (the borders and title bar have a lighter colour) if any other part of the application is clicked other than the JDialog with focus. The user is made aware of the window in focus to attend to first. I have a Swing application with custom dialogs, setUndecorated(true) and custom title bars. Is it possible to implement the behaviour described above for these custome dialogs?

    Read the article

  • Get rid of wasted/unused space in a JMenu

    - by Trevor Harrison
    In my app, I've got a menu bar with a File menu. In the submenus, each JMenuItem is wasting a lot of white space to the left of the text for a checkbox (I think), even though I'm not including any JCheckBoxMenuItems. I'm seeing lots of other java/swing apps who's menus don't waste this space. How do I do it in my app?

    Read the article

  • Custom Monitor Resolution not recognized by Java

    - by Angie
    My weird monitor's native resolution isn't recognized by Windows, so I have to set a custom resolution for it. The problem is that java doesn't recognize it since it's not on Win7's "approved" list, so full-screen mode gets "stuck". Netbeans comes out of full-screen fine, so there has to be a way around this. Anyone know it? This example reproduces the issue: package resolutionexample; import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import javax.swing.JFrame; import javax.swing.SwingUtilities; public class Main { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run() { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); DisplayMode currentDM = gd.getDisplayMode(); boolean currentInAvailable = false; System.out.println("Available resolutions:"); for ( DisplayMode availDM : gd.getDisplayModes() ){ //System.out.println(availDM.getWidth() + "x" + availDM.getHeight()); if ( availDM.equals(currentDM) ){ currentInAvailable = true; } } System.out.println("Current resolution: " + currentDM.getWidth() + "x" + currentDM.getHeight() ); System.out.println("Current in available: " + currentInAvailable); JFrame frame = new JFrame("Resolution Bug Example"); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); if ( !gd.isFullScreenSupported() ){System.exit(0);} gd.setFullScreenWindow(frame); gd.setFullScreenWindow(null); } }); } } Output running 1680x1050 (the monitor's wonky native resolution): run: Available resolutions: Current resolution: 1680x1050 Current in available: false Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid display mode at sun.awt.Win32GraphicsDevice.setDisplayMode(Win32GraphicsDevice.java:393) at sun.awt.Win32GraphicsDevice.setFullScreenWindow(Win32GraphicsDevice.java:329) at resolutionexample.Main$1.run(Main.java:43) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) BUILD SUCCESSFUL (total time: 2 seconds) Output if I set my resolution to 1024x768 before running: run: Available resolutions: Current resolution: 1024x768 Current in available: true BUILD SUCCESSFUL (total time: 2 seconds)

    Read the article

  • Java - How to set focus the already running application ?

    - by Brad
    I am using a ServerSocket port to run one instance only of my Java Swing application, so if a user tries to open another instance of the program, i show him a warning that "Another instance is already open". This works fine, but instead of showing this message i want to set focus on the running application itself, like some programs does (MSN Messenger), even if it was minimized. Is there a solution for this for various operating systems ?

    Read the article

  • scala Slider throws casting exception

    - by coubeatczech
    hello, I create an Slider object: val slider = new Slider{ min = 0 max = 30 labels = Map(0 -> new Label("Nula"),15-> new Label("Pul"),30-> new Label("Max")) paintLabels = true } when I run this, an exception is thrown: scala.swing.Label cannot be cast to java.awt.Component but why? When i browse the docs, the excpected type for labels is a Map[Int,Label].

    Read the article

  • Which is better: JNP or Corba?

    - by Juvinao
    Hello. I've try with EJB 3.0 and swing client and i've tried with glassfish and jboss as application server when i did use glassfish, the comunication is via corba. when i did use jboss, the comunication is via JNP. in my tests the JNP was faster than corba who has some like this?, and who could tell me which is better: JNP or Corba? and why? thanks

    Read the article

  • Java app makes screen display unresponsive after 10 minutes of user idle time

    - by Ross
    I've written a Java app that allows users to script mouse/keyboard input (JMacro, link not important, only for the curious). I personally use the application to automate character actions in an online game overnight while I sleep. Unfortunately, I keep coming back to the computer in the morning to find it unresponsive. Upon further testing, I'm finding that my application causes the computer to become unresponsive after about 10 minutes of user idle time (even if the application itself it simulating user activity). I can't seem to pin-point the issue, so I'm hoping somebody else might have a suggestion of where to look or what might be causing the issue. The relevant symptoms and characteristics: Unresponsiveness occurs after user is idle for 10 minutes User can still move the mouse pointer around the screen Everything but the mouse appears frozen... mouse clicks have no effect and no applications update their displays, including the Windows 7 desktop I left the task manager up along the with the app overnight so I could see the last task manager image before the screen freezes... the Java app is at normal CPU/Memory usage and total CPU usage is only ~1% After moving the mouse (in other words, the user comes back from being idle), the screen image starts updating again within 30 minutes (this is very hit and miss... sometimes 10 minutes, sometimes no results after two hours) User can CTRL-ALT-DEL to get to Windows 7's CTRL-ALT-DEL screen (after a 30 second pause). User is still able to move mouse pointer, but clicking any of the button options causes the screen to appear to freeze again On some very rare occasions, the system never freezes, and I come back to it in the morning with full responsiveness The Java app automatically stops input scripting in the middle of the night, so Windows 7 detects "real" idleness and turns the monitors into Standby mode... which they successfully come out of upon manually moving the mouse in the morning when I wake up, even though the desktop display still appears frozen Given the symptoms and characteristics of the issue, it's as if the Java app is causing the desktop display of the logged in user to stop updating, including any running applications. Programming concepts and Java packages used: Multi-threading Standard out and err are rerouted to a javax.swing.JTextArea The application uses a Swing GUI awt.Robot (very heavily used) awt.PointerInfo awt.MouseInfo System Specs: Windows 7 Professional Java 1.6.0 u17 In conclusion, I should stress that I'm not looking for any specific solutions, as I'm not asking a very specific question. I'm just wondering if anybody has run into a similar problem when using the Java libraries that I'm using. I would also gladly appreciate any suggestions for things to try to attempt to further pinpoint what is causing my problem. Thanks! Ross PS, I'll post an update/answer if I manage to stumble across anything else while I continue to debug this.

    Read the article

  • TextField Listener

    - by coubeatczech
    Hi, there's a swing JTextField, and I want to add a listener, so whenever the users types a single letter, there's an event. There's a ValueChanged event in scala api, but I don't get it what's it's peer. So which one Listener should I use? KeyListener and implement reasonably just one method?

    Read the article

  • Dynamically refresh JTextArea as processing occurs?

    - by digiarnie
    I am trying to create a very simple Swing UI that logs information onto the screen via a JTextArea as processing occurs in the background. When the user clicks a button, I want each call to: textArea.append(someString + "\n"); to immediately show up in the UI. At the moment, the JTextArea does not show all log information until the processing has completed after clicking the button. How can I get it to refresh dynamically?

    Read the article

  • Java - How to force resize JCheckBox to prevent clicking the empty space ?

    - by Brad
    When i create a JCheckBox in my Swing application i leave some extra space after its label, so if the JCheckBox label is for example 100 pixels width, i make the JCheckBox 120 pixels for safety. The problem as at runtime, it's not nice that a user can click on the empty space after the JCheckBox label and it can be actually clicked, like this : I wonder if there is a way to resize the JCheckBox at runtime to exactly fit the text inside it, depending on the font type/size used ? This seems fancy a bit, but i like to make things look perfect :)

    Read the article

  • How to change the cursor blink color?

    - by Nitz
    I don't know this is possible or not? But i want to change the this cursor blink color...which is normally black.... i am making one java-swing based project and in that...one of the requirement is to change the color of the cursor blink.... Is this possible?

    Read the article

  • java AWT native OS library ?

    - by JavaUser
    Hi, As we know AWT classes uses native OS libraries for creating GUIs but Swing uses Java library itself for creating the GUI.Can anyone please give me an example of the Windows OS library corresponds to a AWT GUI ? Thx

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >