I wish to have an internal (non window) dialog to ask for member input. I would like the dialog to be placed centrally on an existing JPanel.
I have looked at layeredpanes and these seem unusable due to only having a single layout manager (or no layout manager) across all the panes. I guess I could try to override JLayeredPane and provi...
I have a JTable that is within a JScrollPane. Rows are added to the table at runtime based on events that happen in my application. I want to have the scoll pane scroll to the bottom of the table when a new row is added to the table.
For JLists There is the ensureIndexIsVisible() that forces a particular index in the list to be visible....
Hi,
Is there a way to make a lazy loading with Swing JList ?
Cheers,
...
My team is embarking on its very first GWT project. We are fairly strong with Swing applications, with almost all of our work involving significant Swing GUIs.
However, this is our very first foray away from the Desktop and to the Web, and the project requires us to use GWT. The project itself is pretty straight forward, the only unknow...
Is it possible to get the selected row index from my table model?
My object already knows about the table model. Instead of passing a reference to the table it self can i get the selected index using the model?
...
So I have lots of tables and lots of cell editors, with lots of stuff in them. I figured I should be reusing them, not doing new() every time since the whole thing is set getTableCellEditorComponent() but still, nearly every time I try to do it, I get "leftovers" in old cells, and other oddities. I can usually correct the problem by ju...
I have a Maven project using the Swing Application Framework and would like to inject project information from the pom.xml into my application's global resources to avoid duplication.
The base application (provided via netbeans) uses Application.title, Application.version, Application.vendor, Application.description resources etc for ...
I created a simple netbeans plugin (see this tutorial) and now i wanna test e.g. the Actionlistener.
But how can this be done ?
to be more specific
what test frameworks suit netbeans plugin development ?
how to create a test setup which emulates enough of netbeans e.g. to test the simple actionlistener ?
Update
a practical example...
Suppose you have a JTable and for each cell you want to display three strings with different color, say value1 (red), value2 (blue), value3 (green).
I overrode the getTableCellRendererComponent of DefaultTableCellRenderer but setForeground(Color) method gives an unique color for all the string showed in the cell.
@Override
public Compo...
I need a simple way to implement a Calendar (similar to google calendar) in java. The calendar must display Monday - Sunday at the top and each hour as a row.
Monday | Tuesday | Wednesday
08:00
09:00
10:00
11:00
How would one create a calendar in Swing like that? I'm using Netbeans IDE. Each column should be able to hold some te...
I would like to create a new event-dispatch thread in Swing, and I'm having trouble finding any references online for how to do this. I have done this in .NET by creating a new thread and calling Application.run(...). Has anyone done this? Is it possible in Swing?
FYI the reason I am trying to do this is because I am writing an Eclip...
Whenever I remove and add swing components from say JPanel, shall I perform call on validate or revalidate?
...
May I know how can I determine whether a component is found in JPanel?
boolean isThisComponentFoundInJPanel(Component c)
{
Component[] components = jPanel.getComponents();
for (Component component : components) {
if (c== component) {
return true;
}
}
return false;
}
Using loop is not efficient...
Hi
I'm developing a swing app which suits the MVC pattern and I'm wondering about the best place to store settings such as width/height, xml files location... Should those settings be avaiable also only through the Model? Should I use a global static class? A singleton?
Thanks in advance
...
I've found a sample for a sorted JList, but my application is powered by an embedded H2 database so I'm wondering if there isn't a better way to implement this with that in mind. Especially considering the table in question could become enormously large, and duplicating all that data in a JList's list model seems to kinda defeat the poi...
Has anyone tried mixing JavaFx and JRuby? I've built a desktop JRuby application with a Swing GUI (100% JRuby) and I'm toying with the idea of replacing the GUI with JavaFx for a more slick feel.
To fit with my current application I want to implement an MVC pattern with the View being JavaFX and the Controller and Model being Ruby. ...
Is there a way of preserving the natural size of a JButton in the center of a BorderLayout? Right now, it expands in all directions to fill it up, but I want it normal size.
If it isn't possible, how can I get a button to be in the center of a panel with its normal size?
...
So I have custom CellEditors and CellRenderers and although I am doing
component.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
component.setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
component.setOpaque(true);
in my getTableCellRendererCompoent, the col...
OK, I know how to make a simple custom JComponent. I know how to override a TableCellRenderer. I can't seem to combine the two.
Here's a sample JComponent I created:
public static class BarRenderer extends JComponent
{
final private double xmin;
final private double xmax;
private double xval;
public BarRenderer(double xmin, double ...
I'm developing a java app with swing in Windows.
The problem is: after pressing (and releasing) the ALT key, the next key press has no effect (there won't be a keyPressed event fired). Only the releasing the next key will be recognized. Pressing and releasing CTRL or SHIFT after ALT has no effect at all. The you first have to press anot...