Hi, this is my first post here. I'm using a JTable to display data from a JDBC ResultSet and I added a popup menu to the JTable (activated with the PopupTrigger) to display options related to the selected row like DELETE, UPDATE, etc.But the problem is that if you right click (the PopupTrigger ...
I am having problems with the monospaced font in Swing. It appears that the "O" (capital letter o) character has somehow been switched with the "0" (zero) character, because the letter shows up as the number and vice versa. The problem only happens with the "Monospaced" and "DialogInput" fonts, ...
I am trying to run this calculator, i need the calc method to run when the male Radio Button is pressed and the calcFemale method to run if the female Radio Button is pressed. The radioButton methos works for but the calcFemale one doesnt when the female Radio Button is Pressed. Please help, ...
463 byte By
cyshanga at 2007-9-30 0:15:02
Hi, I would like to set the column width of JTable.========================================JTable table;DefaultTableModel tableModel;tableModel = new DefaultTableModel();table = new JTable( tableModel);JScrollPane scrollPane = new JScrollPane(table);for(int i = 0; i < heading.length; i++) { ...
Hi everyone,I face a problem: I want to call getCodeBase from a JApplet toload a sound. Instead I receive this NullpointerException.Can someone help me?import javax.swing.*;import java.applet.*;import java.awt.*;import java.awt.event.*;import java.net.URL;public class OpenFile extends ...
I want to remove items from a list, however I do not want the list to reorder(shrink) i want all the old indices to stay the same.Can you setElementAt(index, null)So that the item is null and will not be displayed but will leave the size of the list the same?Hpe yo can ...
Hi,i want my frame to be static in size, i.e. i dont want the user to be able to resize my frame.what method of JFrame can i use for this, i was not able to find an obious one in the API.ThanksJo
Hi,I was wondering how to jump from one JTextArea to the next using tap. I have a gui with two adjacent text areas, so pressing tap should make the curser jump from text area A to text area B.regardsJo
hi,i added jpanel object inside a jframe objects container as follows.setSize(570,470);panel=new JPanel();panel.setLayout(null);Toolkit tk=Toolkit.getDefaultToolkit();Dimension d=tk.getScreenSize();panel.setSize(d.width,d.height);JScrollPane sp=new ...
Hi!I need the text component for image and text or only the text output. I also need scrolling, if it is needed, and auto line wrapping.In general, I need multiline JLabel with scrolling, line and word wrapping.
Hi!!Any ideas on how to close a JWindow, (i.e. to make it go away).A Jwindow does not have any 'close' buttons or any title bar. indianCoffee
How to draw lines on JLabel when the mouse is moving? I would like to draw the coordinate lines (x - axle and y -axle) when I move the mouse, and the intersection point of the 2 lines is the mouse coordinate. The 2 axles will move with my mouse coordinate point, and the lines will display on a ...
198 byte By
ger8a at 2007-9-30 0:17:02
Hi, help me please, any one knows how i can create my personal listener for my personal Event?For example i want a listener for the change of the Font or other properties.Thanks
I have an application that runs fine under win2000 but under winXP I have the following error. The problem here is I cannot find whats causing the error in my code, I dont have any internal frames... java.lang.ClassCastExceptionat ...
I set the rollover effect of the toolbar JToolBar.setRollover(true) and i pack the container (JFrame), usual stuff. The default L&F is used (metal) as i don't set any during initialization. Later, when I set another Look&Feel (even metal), the rollover effect is ...
407 byte By
ETCHUAa at 2007-9-30 0:17:49
I have been using Jbuilder for a couple of years and was thinking about Netbeans. I use the GUI to build the swing windows that I need but when I try to import the same .java into Netbeans I can no longer see the GUIs. It appears that I will not be able to switch between different IDE's. Does ...
I have a Jbutton in my Application that validate the customer id and according to the valid customer id it shows another frame ..sometimes that button freezes and gives no response to the user ..the same problem occures later in the next frame when the customer select a value from combobox, the ...
i cant figure out any way by which i can trap the double clickalso, how do i test which mouse button has been clicked?is there any class or inbuilt java functionality which lets me to the above mentioned tasks.......plz let me know
I have to reload my tree - and restore the expended paths.Before rebuilding the tree model - kepp the last nodes that were expended:and then after the building i search for these nodes at the new model (by id) and re expend them.unfortunetly - some of the nodes are not expended after this ...
Hi,Can anyone point me to a document/web page that contains ALL the changes that were done between 1.3.1 and 1.4.x ?I'm in particular interested in the changes that the Swing package has undergone, and even more importantly what can I do to keep the look & feel of my application as ...
hiI would like to implement a Jframe that is not decorated but it has the abilities of resizing and drugging.I added my implementation here (which is taken from a combination of classes i found on the internet)- but it does not work good - the frame "jump" when it moved...I think the drugging ...
Hi Swing,I have a snippet of code that I took from the Swing guide for JTables that adds a JComboBox into the 3rd column in the table. However, the ComboBox doesnt appear?Can anyone see what is going wrong? Code is below:- I can post more if needed:-public void addTable() {tableModel = new ...
Hi Swing,I have a snippet of code that I took from the Swing guide for JTables that adds a JComboBox into the 3rd column in the table. However, the ComboBox doesnt appear?Can anyone see what is going wrong? Code is below:- I can post more if needed:-public void addTable() {tableModel = new ...
Hi,How to draw moving cordinate lines with mouse moving on a button? I would like to draw a x-axle and a y-axle on a button, and the intersection point is the point of the mouse. When mouse is moving, the 2 axles are moving with the mouse. I suceed in doing this on the a lable and a panel. but ...
HeyIn my program i set accelerator F2 for one of my menu item. I put the menu item to all the windows that open by my application.The problem come up is .. first i have window A and then coz user click something come up window B which is a non-modal dialog. The problem come up is .. eventhough ...
Hello guys,can someone look at the code below and tell me how to add some code which enables two columns to be editable and not ust the one as stated below:public boolean isCellEditable (int row, int column ){return (column == datefrom);//I know it has to be added here but dont know how!?}The ...
Hello guys, I'm having a little problem. I crate a JTable and I wanna resize it, fellow the width of the String in the columns, i.e, when I get a Query (many strings ditributed at many columns). I wanna get the biggest String at the "X" column and resize this colum.Another problem consist of ...
Hello,Im trying to display a jpg picture, and i want it to resize the frame to the size of the picture This is what ive got so far:public class PopupManager extends JFrame {static String imageFile = "maniac.jpg";public PopupManager () {Image image = ...
I am trying to develop an editor for 8085 assembly language programming. I need to display all key words like MVI MOV ADD ADDI etc in a colour different than the rest of the text. How do I do it? Any help would b greatly appreciated.
My code goes like this:public class EditorPanel extends JPanel implements ActionListener{private JTextPane write;private JScrollPane scrollpane;public EditorPanel(){write = new JTextPane();scrollpane = new JScrollPane(write);write.setPreferredSize(new ...
It seems that J2SE 1.5 beta 1 adds the necessary MIME settings to Gnome when one installs the J2SE 1.5 RPM on Fedora Core 1. This is great and I was delighted to see that JAR files can now be run by clicking on them in Nautilus. Finally! Anyway, the point of this post is to say that the window ...
CHAPS.I wud like to use a JPanel in my custom cell rendererto return back the number of items in my list.So i want the display to be this:1Java2C++3CobolI wud like to use JPanel as the label can contain other components.But I am not getting the concerned output.Can someone please tell me where ...
Hai,I wan't to use an Array of JLabel, I don't know if this is possible, but my compiler seems to be okay with it.I'm using the next code for decleration:private javax.swing.JLabel[] lblApplicatieAlgemeen;and I'm using the next code to "create"(?) the labels:public void ...
Hi,Please see the code below. I try to save a file with illegal characters and I need to display an error message and then show the JFiechooser back. I am having problems here.int tt = m_chooser.showSaveDialog(null);if(tt == JFileChooser.CANCEL_OPTION){....}else if (tt == ...
My problem is that I want to start my GUI:s window minimized and then let user maximize it by clicking on it in the taskbar. But when window is maximized, the menu in the window is gone and it looks like the whole window is moved up so that some components cant be shown. What should I do? I ...
Hi,I want to increase the number of rows of a JTable within a procedure!Is there a fast way to do it? I dont found it!Thanks!Al
200 byte By
mehappya at 2007-9-30 0:23:14
Dear experts.I am saving text to a file (new file). When I open the file there are some notes preceding the text. How can those undesired notes be eliminated?Thank you in advance.
152 byte By
zzpprka at 2007-9-30 0:23:20
Hi GuysI neec to use word wrap in JTable cells but can't figure-out how to do it; can any of you help me?Many thanksPatrick
I have a JTable within a JScrollPane. I have a simple function that sets the selection to a single row and scrolls that row to be visible. All works as expected, except when the call to scrollRectToVisible() needs to scroll up (because the given Rectange is above the current view. Then it does ...
I have written a JFrame containing a JTable and a "next>>" button. If i have finished inputting all data into the table and press the next button, it always can't read the last data i have inputted.I think that the system believe i am editting the last cell and haven't finished yet when ...
Hi,Does anybody here knows how to make swing handle with chars like: ? ? ?, and so on...Always I use this kind of chars on a JOptionPane, or a JFrame, or whatever in swing, this chars are replaced by a dot-pointed square.Thanx !
Is it possible to get information about the colours and fonts used by the current look and feel? I am writing an extention to JButton, overriding paintComponent, and I want to paint the text using the normal font for a JButton, whatever look and feel is installed.AJ
223 byte By
_ertria at 2007-9-30 0:24:15
How can I locate the cursor at a specific column in a specific line, say, line 1, column 1, in a JTextPane?Or is there an alternative that supports locating the cursor at a specifice column in a specific line?
124 byte By
_ertria at 2007-9-30 0:24:18
How can I set the selection to from a,b to y,z where a, y are line numbers and b, z are column numbers?Thanks!
how do i draw lines with different styles, like the dashed, dotted, centre line, n other kind of line?
283 byte By
sheawha at 2007-9-30 0:25:51
Hello, I want to know why, when I execute JLabel's setText(String str) method, the JLabel's text will be set to value of str, but at the same time,the JPanel will reset the JLabel's location?Besides, how can I solve the problem?Thanks all
Hi,I齰e change the data of a JTable from a Personal TableModel that inherites from AbstractTableModel.Anyone knows how to launch an update call so the Table is updated when I changed the internal data?Thanks,Al
205 byte By
Exclama at 2007-9-30 0:26:02
Hi everyone!one short question: how can I add close-Icons to a JTabbedPane? every panel should have a "X" - ImageIcon, so that it can be closed with a mouseclick.thank you!Guido
I have created and set a custom cursor in a JFrame in an application, but when I create a Dialog Box and move the mouse into it, the cursor changes back to the system default. Does anyone know how to fix this so the custom cursor is always shown? Also, the same thing happens if I move the mouse ...
200 byte By
L_D_Aa at 2007-9-30 0:26:42
Hi,when I press Enter in JTable, I want select next cell in the same row, not cell in next row.I can not use setSurrendersFocusOnKeystroke(true).How to do it ?Thanks