My objective here is to obtain a console-like-behaving component in Java, not necessarily in JTextArea, but this seemed like a logical thing to try first. Output is simple enough, using the methods provided by the JTextArea, but input is another thing. I want to intercept input, and act on it - character by character. I've found some exa...
Hey,
I have this frame:
Here is what happens:
When I'm over the Pinkish panel, the scroll pane works just fine.
When I put the mouse over the Darker gray JTextArea the scroll pane does not get the event.
In general my question is how can I make sure the parent of a component receives the event if the component didn't handle that ...
I'm implementing a GUI application in Jython, using Eclipse and PyDev plugin.
The problem is that I have a hard time using the builtin debugger. When I start a debug session it just stops. Of course this should be expected as the program just creates a JFrame and then it's finished.
So any breakpoints I put for different events .e.g. ...
What I am trying to do is have a small splash screen appear while my program is loading something. This is what I have:
SplashScreen.showSplashScreen();
// Do stuff that takes time.
SplashScreen.hideSplashScreen();
All the showSplashScreen() method does is create a new JWindow in the middle of the screen and make it visible.
Now this...
Hi,
I am developing a simple swing app in which I have a main window with three buttons. When I click on the first button it opens new window of (200,200) dimension. When I click on the second button, the newly opened window's height should get increased and when I click on third button height should get decreased. Can you help me with ...
We are seeing Spring in school right now but we don't have the time to wait till the end of the semester to start developing an application. We continue using an app we made last year, and are writing the service layer right now.
The problem is our "client" wants to have a desktop client and a webpart, which used the same dtatabase. Thi...
Hi,
I have been working on a Swing based java program for a while now, today I have been editing the JComboBox (using Netbeans so I am unable to directly edit the code for it), at some point between edits the below errors have sudddenly appeared.
Obviously at this point there is far too much code involved to post, but does anyone have a...
What's the programmatic equivalent of clicking the close (x) button in the upper right corner of a JFrame?
There's the dispose() method but that's not the same thing, since a JFrame can be set to do several different things upon closing (not to mention if there's a WindowListener involved)
...
For a hw assignment, I need to setup a JTable in Swing, and populate the table's contents via a custom model class that extends the AbstractTableModel. My questions regarding this overly complicated process are many fold, but I'll try and keep it simple.
My first step is to get data into the model right? When I was using a JList (I coul...
Hi,
I'm trying to render an specific row of my jtable (it should have a different background color and it should have bold characters).
I found several questions regarding how to implement a custom TableCellRenderer (here and here) and the tutorial How to Use Tables and this one (Table Row Rendering).
I'm using a JInternalFrame to dis...
Can't seem to figure out how to only show one circle. Was trying to //g.clearRect(0, 0, 400, 400); but that clears the background too. Was also trying to just fill the background with yellow again but couldn't get that working either. Any suggestions?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class JMous...
Hi, I have this strange bug with my popup menu. It happens rarely and seemingly randomly. The problem is when I have a submenu in my JPopupMenu - when I select the submenu, main menu disappears and the submenu is painted incorrectly (it's like the buffer of main menu is painted over the submenu). I can still navigate it using keyboard.
...
I'm create simple gui form with one button in IntelliJ IDEA 9. Class wich was created with form is not JFrame or any another swing class. How i can call my form in my source code?
...
Hi All,
I wrote small java Swing/canvas program where I can draw some textboxes.
Now I'd like to export those text areas to a set of HTML div.
What would be the best way (font-family ? font-face? css selectors ?) to obtain the same rendering as in Java ?
Thanks
...
Okay, so I'm trying to make a hex editor, and I'm trying to make a load JMenuItem, but it's not working. The JFileChooser OpenDialog just doesn't show up, and no errors are being shown.
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.util.Vector;
import java....
I have some JScrollPanes on my hex editor and they're not showing up.
Any idea why?
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.util.Vector;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
public class HexEditor extends J...
Hi,
I'm trying some GUI development in Java and when I added the following code, I got a runtime error during initialization of the class:
public class Search_Album_Main_Tab extends JPanel{
JComboBox search_list;
JTextArea searched_data;
JButton search_button;
Results_Main_Tab rmt;
Search_Action_Listener lis...
I have a program that get's input string with file path in one JTextArea and then loads it's content to a second JTextArea. Problem is that when using JTextArea I cannot add an actionListener that will load content in the second JTextArea when leaving this field. How to get around this problem ?
protected JTextArea inputField, outputFie...
Alright, so I'm writing a hex editor in Java and when I load in a file around 2MB or bigger it just freezes. No errors show up though, so I'm not sure whats going on. Can anyone help me? This is the code:
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.util.V...
Hi,
I've decided to have my own custom UI of JToolBar by
subclassing BasicToolBarUI, as part of my Swing program.
It works great under OS X (10.6) and Windows (7), but
when it comes to Linux, problem occurs:
If the swing component is
Using SystemLookAndFeel (With Java LAF it is shown)
Using UI BasicToolBarUI (To simplify the problem...