Hello AllI need help with creating an xmlViewer, using Table Layout, im not using any jtree in my implementation, just a simple viewer, with a button in the first cell of the table, and name of the Element in second cell and the third cell has the children and attributes to that Element.I know ...
325 byte By
zcox456a at 2007-9-30 1:23:25
Does anyone know of any good tutorials on implementing the CellEditor interface (or extending AbstractCellEditor, etc.). I need to use either a JSlider or a JProgressBar as the editing component in a table. DefaultCellEditor is nice but you can't use either of those Swing components with ...
776 byte By
Planmana at 2007-9-30 1:23:41
hi,I developing an application on a Linux/Windows platform and I've been trying to change the look and feel of my application using a number of third party themes (jgoodies, kunststoff). What's happening is that I get the look and feel in the components (buttons, tabs, etc..) but not on the ...
Hi all, I have a JFrame with a JTable inside it. Now if I resize the JFrame with my mouse, the JTable will resize with it. However, if I resize the JFrame programatically, the JTable will remain at its prefeared size. It will not resize to fill the JFrame (horizontally at least). Is there any ...
Hi,Does anyone know if i can paint the background of a JPanel to replicate the current lookandfeel title bar e.g. on windows 2000, a gradient fill from navy on the left to skyblue on the right. Its not the technique of using a gradient fill that i'm after, but how to determine at runtime what ...
I'm working on a project where we allow clients to script our components using Javascript. Currently, all we're providing is a basic textarea with a minimum of added features - we've got search, but that's about it. We'd love to be able to replace the TextArea with something this is1) Much ...
plz help me solving foll error. rest all files are imported properly.what is the exact location/hierarchy of each jar file?"Viewer.java": Error #: 704 : cannot access directory com\sun\java\swing\event at line 6, column 1
I'm having problems putting a table inside a JScrollPane so that part of the table shows and the rest scrolls to the right.The issue is that the cells in the table just get smaller instead of staying the same size and showing a scroll bar.This is part of code I have so farJScrollPane js = ...
199 byte By
jaya22a at 2007-9-30 1:25:54
Hi,I tried the following code on a JButtonJButton eg = new JButton("Cancel");eg.SetMnemonic(KeyEvent.VK_C);however nothing get underlined.I am using 1.4.2_03
534 byte By
hendoga at 2007-9-30 1:25:57
Here is what I need to do:- Maintain 1 and only 1 model for tree data- Display two different JTrees, each using the same model, but one showing all the data, and the other only showing a subset.Example:My Tree Data model is a file system containing all drives and folders below them.One tree ...
Hi!I am using GridBagLayout as my layout manager for my parent JFrame. And I want to add a JPanel to it asa drawing region. But, the size somehow does not get set even though I have specified the gridheight and set a preferred size on my JPanel subclass. Here's a code ...
821 byte By
bryanjja at 2007-9-30 1:26:10
I'm trying to have recursive drawing objects, but the top level object always hides the others. here's example code of what i'm trying to do. any suggestions?class myCircle extends JPanel {public myCircle(int x, int y, int radius) { ... }protected void paintComponent(Graphics g) ...
Hi,I wonder if it is possible and if, how you do, to tile a background image in a JApplet.Thanks,Joachim
366 byte By
rabona at 2007-9-30 1:27:44
Hello,I'm working with some JScrollBars, but I want to give them a more unique look, because it's for use in a game. But I'm not sure how to repaint them. should I override the paintComponent method, and how will I know all the dimensions of al the parts of the scrollbar? Does anyone have ...
219 byte By
bb@a at 2007-9-30 1:28:10
I am using JDK1.4.1. And I have to use only JDK1.4.1.addSeparator() method of JToolBar Class is putting pipe between the buttons instead of space.Please provide me any help. Thanks in advance
I am using many editors like JTextField & JButton, JComboBox, List etc. in my JTableAll the things are working properly.Now i want the feature such that when table is navigated using Tab or Right-Left Arrow buttons the editor gets activated without pressing F2 or any key. ie Tab navigation ...
1980 byte By
ossix06a at 2007-9-30 1:28:17
JDK 1.4 doesn't have a delayed transferable feature: useful for transferring files from your swing application to the native desktop/fs without preparing the files at the start of the drag.One workaround I've been developing for this is to take an ordinary "FileTransferable extends Vector ...
Hi All,Can anyone please tell me how to make panels in a frame behave in the same manner like floatable toolbar behave?I want to do the application like here http://troyer-is.com/jdocking.php3.Regards,Shankar.
Hi,I have an application that needs to display an icon.The icon to display is in a separate package:So in my class I am importing this package:import phone.plaf.iconsNow how do I display the icon ?For the moment,I have copied this icon to my c:and am displaying it.Now,I want this to be ...
491 byte By
neiana at 2007-9-30 1:28:59
I'm just new in using java swing and I have encountered a compile error when I tried to use the addTab method.//add tabbedPane.addTab("Panel One", new TabIcon(), new SampleA(), "Click here to see Demo");where SampleA() is a class that extends JFrame.the compile error message is ... ...
Hi,I'm currently having a problem with a scanning application I am working on. This swing application present the user with a Frame, containing a toolbar and a 'SplitPane' (the SplitPane is half JScrollPanel and half JPanel, i.e. image on one side of the screen and input fields on the ...
3037 byte By
bilcoa at 2007-9-30 1:29:57
Hi,I've created my own JButton to make the Button appear more professional.(See Code below)But when do the same from a JToggleButton (by making the Class below extend JToggleButton instead), any time I put the mouse over the ToggleButton, it increases in size, then stays that way.Is there any ...
721 byte By
zehda_a at 2007-9-30 1:30:01
Hi, I'm using GridBagLayout for almost all my layout tasks as it apears the most flexible one, and i'm having this problem: the components are layed out ok when i start up the application, but when one of the components changes (for example: i'm updating the text of some labels dynamically) ...
Does an ActionListener also listens to the actions you make in code?For example....I've got a ComboBox with an ActionListener: addActionListener(new ActionListener(){public void actionPerformed(ActionEvent evt){ComboBoxAction(evt);}}); I just want that action to be excecuted when the user ...
Hi all,I'm looking for a way to create a JCheckBox with 3 states: on/off/between. This is for use in a JTree, where every node has a checkbox. Each checkbox will be selected if all childnodes are selected, deselected if all childnodes are deselected, and semi-selected if some childnodes are ...
Is it possible to create a Glass Pane which is bigger than the JFrame underneath? If possible then how to do it?Regards,Koushik
I have a JSlider, and I have my own sliderUI ....however, the thumb on the slider is no longer the default "java blue" color when you click on it....instead the thumb goes from a blue to dark-dark blue from the top of the thumb to the point.anyway, my sliderUI extends MetalSliderUI and the code ...
Hi!I have a question about buttons. I must create a dynamic gui in java. For this I have witch each dynamic thing a button witch have a different function. Till now on i have this: for (int i = 0; i < 4; i++) {jPanel4 = new javax.swing.JPanel();jButton5 = new javax.swing.JButton();jButton6 = ...
15536 byte By
dlufta at 2007-9-30 1:30:39
I have a JTable that I have set up to create a new line and set focus to it when the user tabs from the last row in the table. That part works, but after you hit Tab from the first column of the rew record that was inserted, it jumps to the top of the table....Anyone have any ideas? Here is the ...
113 byte By
drozdeka at 2007-9-30 1:30:42
Hi All.The borders are glue, so i need to add space between a border and another one.Thanks.
294 byte By
gicya at 2007-9-30 1:31:02
I have the homework that is to write a swing painter like microsoft windows mspaint.but, the problem is that if i change the swing window size, the picture drawn will partially disappear.how to solve this problem? have any good references for me?thx.........
There's a method call returning a list of EventListeners supported by an object?Thanks.
Anyone know how to quickly determine how many lines can be printed per page.I am trying to print the contents of a JTextArea to a Xerox printer. The text will be from 50 to 1000's of lines.How do you determine the lines per page after setting margins?****Secondly how do you determine the y ...
Hi, I am new to Java to start with... I am trying to save the contents of various JTextFields in a text file each one at a different line.So far I have come up with the following:====================================try {FileOutputStream fos = new FileOutputStream("mcsim.rtf");ObjectOutputStream ...
I have a tree in the lefthand side of a splitpane. When the user takes actions on the tree nodes, the righthand side of the splitpane is set to a new panel containing related info. The righthand panel sits on top of a scrollpane. Now the problem: when i move the divider or resize and scoll the ...
Hi,My application connects to a database. At the moment the address location of the database file is hardcoded. I'm looking to add a browse button to my application so that I can connect to the databse at any location. When the file is selected and <OK> clicked I want the JFileChooser to ...
Why does the following code not print "Test" in the JTextArea?import java.awt.GridBagConstraints;import java.awt.GridBagLayout;import java.awt.TextArea;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JPanel;import javax.swing.JTextArea;import ...
138 byte By
pateldwa at 2007-9-30 1:32:10
HiCan someone please show me how I can change the Java Icon in the title bar to my own icon (image)ThanksDilip
hi, i am trying to resize the JPanel (to which i ve added a JScrollPane), using the get n set PreferredSide() methods, but the code doesnt seem to workkindly let me kow, whow to resize the panel for supporting ZOOM IN / OUT feature
Hi,I would like to create a Web Browser. So.. i use MDI and InternalFrames.I have create two class.browserWindow (I have create the JinternalFrame)andBrowser (I have create the mdi+menus+buttons)the problem starts when i want to send an action from the Browser.class to BrowserWindow.eg.If you ...
How do I place OK and cancel button in two different rows(or one below another) as opposed to side by side. I know how to do the later.
Does someone have a Swing(Winows for look-alike screen) where buttons are on the left and labels are in the middle and textfields on right. Can you pass me a sample please?
146 byte By
kidwarea at 2007-9-30 1:33:01
Say I have two JPanel objects occupying the same space. Is there a way to change the zorder of the panels while the application is running?
197 byte By
GumBeea at 2007-9-30 1:33:03
On the JFileChooser's default pop-up, they seemed to haveforgotten to put in a .setMnemonic() on both the "Open" and"Cancel" buttons. Is there an easy way to add this feature?
547 byte By
lee1112a at 2007-9-30 1:33:13
Hi, I have a JTable and I want to set the cellEditor of a ColumnModel to be a JTextArea, to allow multiple lines of text.Anyway, i currently have set a class MyTextAreaEditor which extends DefaultCellEditor. Im not sure where to go from here, because DefaultCellEditor doesnt seem to support ...
I've got a program that has a GUI and uses a modem to talk to a remote terminal.I want the GUI to be updated of the modem's progress, so all modem calls/exchanges with remote terminal are occuring within a SwingWorker thread.The user also has a Cancel button to use to kill the ...
Hey all,Finally got the hang of drag and drop. Not too hard, but a little time consuming. I found an article showing how to capture and drag a BufferedImage within a JTree. When you click and drag a node, it creates a BufferedImage of the node on screen and "ghosts" it a bit, which has a very ...
Hello all, I'm detecting clicks on a JTree, and I want a method that goes from that node to the end of the tree (all the leaves). The method will be invoked if the node has children of course, I want to do this recursively but I don't know how. Can anyone help me;Thanks a lot in ...
Hi,I have a question about using a JTable.I use the Jtable to displaysome data from the database. I have 3 jButtons( 1 month, 5 months and all) which provide the search criteria button 1 month : show all records for the last month button 5 months : show all records for the last 5 months button ...
OK, I have a special field I've created. It's a JPanel, and it contains several JTextFields. Basically it's a date field with the data parts separated into different JTextFields. Lets call it a JDateField. This JDateField is on a JPanel with other fields (JTextFields, JComboBoxes, etc). Each ...