URGENT application ok... applet not ok


Hi

Any of you guru's have an idea about the following.
by the way...just passed the SCJP with 88% but it hasnt helped me with this monkey:-(

Ive been developing a program that gives the user a tree structure on the left hand side of the display and depending on what they select from this tree, a different set of options on the rhs.

The problem is..... it all works fine as an application.
But when i deliver it as an applet i have the following problems on the rhs of the display.

1) Jtextfields are NOT editable\t i can click on them and they seem to get focus but cant edit the dam things.
2) the background colo(u)r for the jPanels, JTextField, Combi Boxes etc are all grey in the applet only. To overcome this I have to explicitly setOpaque to false for every component.

As I have said....it works fine as an application.

I have been randomly repainting things in different ways with no luck.

I cant help thinking this is one of those one liners that'll fix everything.

Anyone got any ideas\t

Got to deliver this in 26 1/2 hours.....doh.

Thats 1/2 hour gone.........26 hour till i get fried:-/

Please help ASAP

Many thanks

ps using remove, the add(JPanelWithNewDisplayStuff)
Then various combinations of validate revalidate paint repaint to update the display.
Posted On: Tuesday 23rd of October 2012 11:28:50 PM Total Views:  192
View Complete with Replies

RELATED TOPICS OF Swing / AWT / SWT PROGRAMMING LANGUAGE




help me out pls it is urgent..

I have the JOptionpane which is poped up when i click some button in JFRAME and i need the Jframe (which is main application here) should be running if the JOptionPane is there contin. ... on the screen . i want the JFRAME application to be working even though the JOPTION PANE is in the on the SCREEN. and dont want a "thread" creation here... as i know JoptionnPane is blocking the thread till we click ok is any other Dialog box there which will never block the thread pls help me out it is urgent.... bye
VIEWS ON THIS POST

87

Posted on:

Wednesday 17th October 2012
View Replies!

plz solve my problem its urgent

i want the clear picture of that if i was select in that table it fires all information in the child window of that particular parent table fields not like a single column or row. and i want to add the image in left side corner of each field and right side the check box and the text fields in middle of the table. if i select the child windows fields it will shows in check box like right(tick)mark. if anybody send the email id i will send exact information
VIEWS ON THIS POST

87

Posted on:

Thursday 18th October 2012
View Replies!

urgent Jtextarea!!!!!!!

Hi all, Can u tell me how to make a Jtextarea as read only after i display some text in it.. Thnks in advance.
VIEWS ON THIS POST

59

Posted on:

Thursday 18th October 2012
View Replies!

requestFocus() is not working across applications

What's wrong with this code I get focusLost() events all right, and when I requestFocus(), I get focusGained().. except it is NOT gained, my caret is still in Notepad! How do I get my caret out of there public class Test { //----------------------------------------------------------------- public static void main(String[] args) { final JDialog dialog = new JDialog((JFrame) null, "!"); final JTextField f = new JTextField(""); dialog.add(f); dialog.setVisible(true); dialog.requestFocus(); f.addFocusListener(new FocusListener() { @Override public void focusGained(FocusEvent e) { System.out.println("gained"); } @Override public void focusLost(FocusEvent e) { System.out.println("lost"); dialog.requestFocus(); // does not help either f.requestFocus(); }}); } }
VIEWS ON THIS POST

174

Posted on:

Monday 22nd October 2012
View Replies!

Help regarding devlopment of Proffesional stanalone application

hi , friends i am going to develop an standalone application in java . that supports 30 features . i will use Microsoft access or MySQL database. it involves too much database operation/transactions , i want to know is there any framework available to make database transaction easy and faster in j2se GUI. Kindly give your suggestion.
VIEWS ON THIS POST

53

Posted on:

Monday 22nd October 2012
View Replies!

help in swing application

I am trying to run shell script from java code the code which i have used is import javax.swing.*; import java.io.*; import java.util.*; class robinswing{ robinswing() { JFrame jfrm= new JFrame ("a simple swing application"); jfrm.setSize(275,100); jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JLabel jlab=new JLabel("aswing demo"); jfrm.add(jlab); jfrm.setVisible(true); } void ExecuteScript() { ProcessBuilder pb = new ProcessBuilder("crtinv1.sh","-n"); pb.redirectErrorStream(true); try{ Process shell = pb.start(); } catch (Exception ignoreMe) {} } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ robinswing a=new robinswing(); a.ExecuteScript(); } }); } The code is running fine.But i need to develop 4 buttons which onclicking will execute with option -a ,-n,-H,-h the code which i tried n failed is import javax.swing.*; import java.io.*; import java.util.*; import java.awt.*; import java.awt.event.*; class robinswing{ JFrame jfrm= new JFrame ("a simple swing application"); JLabel jlab; robinswing(){ jfrm.setSize(275,100); jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jfrm.add(jlab); jfrm.setVisible(true); JButton alpha=new JButton("info"); alpha.addActionListener (new ActionListener(){ public void actionPerformed(ActionEvent ae){ jlab.setText("alapha was pressed"); } }); jfrm.add(alpha); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ robinswing a=new robinswing(); } }); } } The code is giving error .what modification should i make
VIEWS ON THIS POST

62

Posted on:

Monday 22nd October 2012
View Replies!

how to build Custom Skin as a main window for application ???

I would like to build application in which I want some different GUI. I want some skin as like our ordinary media player has for user-interaction . . . anybody guide me
VIEWS ON THIS POST

71

Posted on:

Monday 22nd October 2012
View Replies!

when to use threads in swing applications?

when to use threads in swing applications and how to improve the performance of the swing application
VIEWS ON THIS POST

67

Posted on:

Monday 22nd October 2012
View Replies!

Call Swing application with the help of JWS

Hi , I have an Swing application which I want to open from JWS. And in that task I am partially successfull. Means I have to select few files to process. That I have to do with the help of Swing and JWS. But as soon as I opened the file.Swing screen get close and I am not able to process it further more. Please suggest me what I have to do in this case.
VIEWS ON THIS POST

57

Posted on:

Monday 22nd October 2012
View Replies!

Jpcap captured packets not appearing in Swing application's text area

Can anyone help me understand why the Jpcap captured packets are not appearing in the following Swing application's text area import java.awt.*; import java.awt.event.*; import java.text.*; import java.net.*; import java.util.*; import javax.swing.*; import javax.swing.event.*; import jpcap.*; import jpcap.JpcapCaptor; import jpcap.NetworkInterface; import jpcap.packet.Packet; public class JpcapPacketCapture extends JFrame { JFrameframe; JProgressBarprogressBar; JTextAreatextArea; JpcapCaptorcaptor; JpcapPacketCapture packetCapture; int duration; int interfaceNo; static URL url1 = JpcapPacketCapture.class.getResource("images/Start.gif"); ImageIcon start = new ImageIcon(url1); static URL url2 = JpcapPacketCapture.class.getResource("images/Stop.gif"); ImageIcon stop = new ImageIcon(url2); static URL url3 = JpcapPacketCapture.class.getResource("images/Clear.gif"); static ImageIcon clear = new ImageIcon(url3); static URL url4 = JpcapPacketCapture.class.getResource("images/Print.gif"); static ImageIcon print = new ImageIcon(url4); static URL url5 = JpcapPacketCapture.class.getResource("images/Exit.gif"); static ImageIcon exit = new ImageIcon(url5); static URL url6 = JpcapPacketCapture.class.getResource("images/About.gif"); static ImageIcon about = new ImageIcon(url6); static URL url7 = JpcapPacketCapture.class.getResource("images/Logo_Small.gif"); static ImageIcon logoSmall = new ImageIcon(url7); static URL url8 = JpcapPacketCapture.class.getResource("images/Logo_Large.gif"); static ImageIcon logoLarge = new ImageIcon(url8); static URL url9 = JpcapPacketCapture.class.getResource("images/Splash_Scrn.jpg"); static ImageIcon splashScrn = new ImageIcon(url9); public JpcapPacketCapture() { super("Jpcap Packet Capture Version 1.00"); showSplash(4000); FileMenu fileMenu = new FileMenu(this); HelpMenu helpMenu = new HelpMenu(this); MenuBar menuBar = new MenuBar(); menuBar.add(fileMenu); menuBar.add(helpMenu); setMenuBar(menuBar); JToolBar toolBar = new JToolBar(); toolBar.setFloatable(true); toolBar.setOrientation(JToolBar.HORIZONTAL); toolBar.setRollover(true); addButtons(toolBar); textArea = new JTextArea(14, 42); textArea.setTabSize(4); textArea.setFont(new Font("sansserif", Font.PLAIN, 12)); textArea.setCaretPosition(textArea.getDocument().getLength()); textArea.setEditable(false); Container contentPane = getContentPane(); JPanel panel = new JPanel(); contentPane.add(new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS)); contentPane.add(toolBar, "North"); } class FileMenu extends Menu { public FileMenu(JpcapPacketCapture mw) { super("File"); packetCapture = mw; MenuItem mi; add(mi = new MenuItem("Start Capure")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { StartCapture(); } catch(Exception evt) { evt.printStackTrace(); } } } ); add(mi = new MenuItem("Stop Capure")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { StopCapture(); } catch(Exception evt) { evt.printStackTrace(); } } } ); add(mi = new MenuItem("Clear Window")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { textArea.setText(""); } } ); add(mi = new MenuItem("Print Window")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { PrintWindow(); } } ); add(mi = new MenuItem("Exit")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } } ); } } class HelpMenu extends Menu { public HelpMenu(JpcapPacketCapture mw) { super("Help"); packetCapture = mw; MenuItem mi; add(mi = new MenuItem("About...")); mi.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent evt) { JOptionPane.showMessageDialog(frame, "Jpcap Packet Capture Version 1.00 \n\n" + "This progoram uses Jpcap to capture packets for one of this system's \n" + "network interfaces. The specific network interface to capture packets \n" + "for is provided by the user through a program selection dialog. \n\n", "About...", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(logoLarge.getImage())); } } ); } } public void addButtons(JToolBar toolBar) { JButton toolbarButtons = null; toolbarButtons = new JButton(new ImageIcon(start.getImage())); toolbarButtons.setToolTipText("Start capture."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { StartCapture(); } catch(Exception evt) { evt.printStackTrace(); } } } ); toolBar.add(toolbarButtons); toolbarButtons = new JButton(new ImageIcon(stop.getImage())); toolbarButtons.setToolTipText("Stop capture."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { try { StopCapture(); } catch(Exception evt) { evt.printStackTrace(); } } } ); toolBar.add(toolbarButtons); toolbarButtons = new JButton(new ImageIcon(clear.getImage())); toolbarButtons.setToolTipText("Clear window."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { textArea.setText(""); } } ); toolBar.add(toolbarButtons); toolbarButtons = new JButton(new ImageIcon(print.getImage())); toolbarButtons.setToolTipText("Print window."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { PrintWindow(); } } ); toolBar.add(toolbarButtons); toolbarButtons = new JButton(new ImageIcon(exit.getImage())); toolbarButtons.setToolTipText("Exit program."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } } ); toolBar.add(toolbarButtons); toolbarButtons = new JButton(new ImageIcon(about.getImage())); toolbarButtons.setToolTipText("About program."); toolbarButtons.addActionListener ( new ActionListener() { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(frame, "Jpcap Packet Capture Version 1.00 \n\n" + "This progoram uses Jpcap to capture packets for one of this system's \n" + "network interfaces. The specific network interface to capture packets \n" + "for is provided by the user through a program selection dialog. \n\n", "About...", JOptionPane.INFORMATION_MESSAGE, new ImageIcon(logoLarge.getImage())); } } ); toolBar.add(toolbarButtons); } public void StartCapture() { NetworkInterface[] devices = JpcapCaptor.getDeviceList(); String[] names = new String[devices.length]; for (int i = 0; i < names.length; i++) names[i] = i + " " + (devices[i].description == nulldevices[i].name :mrgreen: evices[i].description); Object[] selectionValues = names; String initialSelection = names[0]; Object selection = JOptionPane.showInputDialog(null, "Capture using which interface\n", "Input", JOptionPane.PLAIN_MESSAGE, null, selectionValues, initialSelection); textArea.append(selection + "\n"); textArea.select(0, 1); interfaceNo = Integer.parseInt(textArea.getSelectedText()); textArea.setText(""); try { JpcapCaptor captor = JpcapCaptor.openDevice(devices[interfaceNo], 65535, false, 20); captor.loopPacket(-1,new PacketPrinter()); } catch (java.io.IOException io) { } } class PacketPrinter implements PacketReceiver { public void receivePacket(Packet packet) { str.delete(0, str.length()); str.append(packet + "\n"); textArea.append(str + ""); } } public void StopCapture() { captor.close(); } public void PrintWindow() { final MessageFormat header = new MessageFormat(""); final MessageFormat footer = new MessageFormat(""); textArea.setFont(new Font("sansserif", Font.PLAIN, 9));; try { textArea.print(header, footer, true, null, null, true); } catch(Exception e) { e.printStackTrace(); } textArea.setFont(new Font("sansserif", Font.PLAIN, 12)); } protected static ImageIcon createImageIcon(String path) { java.net.URL imgURL = JpcapPacketCapture.class.getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.err.println("Couldn't find file: " + path); return null; } } public void showSplash(int d) { duration = d; JPanel splash = (JPanel)getContentPane(); int width = 470; int height =255; Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); int x = (screen.width-width) / 2; int y = (screen.height-height) / 2; setBounds(x, y, width, height); JLabel label = new JLabel(new ImageIcon(splashScrn.getImage())); splash.add(label, BorderLayout.CENTER); setVisible(true); try { Thread.sleep(duration); } catch (Exception e) { } splash.remove(label); setVisible(false); } public static void main(String[] args) { JpcapPacketCapture JpcapPacketCapture = new JpcapPacketCapture(); JFrame.setDefaultLookAndFeelDecorated(true); JpcapPacketCapture.setIconImage(logoSmall.getImage()); JpcapPacketCapture.setSize(600, 360); Dimension dim = Toolkit.getDefaultToolkit().getScreenSize(); int w = JpcapPacketCapture.getSize().width; int h = JpcapPacketCapture.getSize().height; int x = (dim.width - w) / 2; int y = (dim.height - h) / 2; JpcapPacketCapture.setLocation(x, y); JpcapPacketCapture.setVisible(true); JpcapPacketCapture.addWindowListener ( new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } } ); } }
VIEWS ON THIS POST

50

Posted on:

Monday 22nd October 2012
View Replies!

putting image files to Jar File in Swing application

Hi , I have a bit problem with my image in my GUI project. I have a method to retrieve ImageIcon like this: public static ImageIcon createImageIcon(Class sourceClass, Stringpath) { URL imageURL = sourceClass.getClass().getResource(path); if (imageURL != null) { return new ImageIcon(imageURL); } else { System.err.println("Couldn't find file : + path"); return null; } } Where should I put the image files in JAR file assuming all my images is in the directory named images
VIEWS ON THIS POST

65

Posted on:

Monday 22nd October 2012
View Replies!

Java Swing Stand-alone application

How do I run this Java Swing stand alone application outside the IDE
VIEWS ON THIS POST

43

Posted on:

Monday 22nd October 2012
View Replies!

Eclipse based application with Java Web Start

I am deploying Eclipse based application with Java Web Start. By default the installation of my application is doing in "C:" drive because I created the jnlp file as below But I need to allow the users to choose the location where they would like to install / deploy the application. Please let me know a) how to get "Browse for folder" button. b) I need to create a dynamic jnlp file based on the user's information. Whether "C:" or "D:" drive. Any information on this is highly helpful for me.
VIEWS ON THIS POST

60

Posted on:

Monday 22nd October 2012
View Replies!

urgent:override a jrame

need help in making my application dispaly with the dialog box appearing at the center.The "InputDialog.java" contains the dialog i want to appear at the center of th "FoodFrame.java" class.pls somebody help me out. codes: //InputDialog.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; import static javax.swing.GroupLayout.Alignment.*; import java.sql.*; public class InputDialog extends JDialog { private JTextField infield,ddF,wkF,mmF,yyF; private JLabel inlabel; final ButtonGroup group,group1; private JRadioButton dd,wk,mm,yy,addweight,lossweight,stress,diabietic,gn; private JButton ok; //private FoodFrame ff; public InputDialog(JFrame f){ super(f,"",true); JPanel p1 = new JPanel(); p1.setLayout(null); p1.setPreferredSize(new Dimension(180,45)); p1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"",TitledBorder.CENTER,TitledBorder.TOP)); inlabel = new JLabel(); inlabel.setText("Amount To Spend"); inlabel.setBounds(60,10,140,30); p1.add(inlabel); infield = new JTextField(10); infield.setBounds(170,10,80,25); p1.add(infield); JPanel p2 = new JPanel(); p2.setLayout(null); p2.setPreferredSize(new Dimension(200,110)); p2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"",TitledBorder.CENTER,TitledBorder.TOP)); dd = new JRadioButton("Number of Day Plan"); //dd.addItemListener(this); dd.setBounds(10,20,140,20); p2.add(dd); ddF = new JTextField(); ddF.setBounds(160,20,30,20); p2.add(ddF); wk = new JRadioButton("Number of Week Plan"); wk.setBounds(10,45,150,20); p2.add(wk); wkF = new JTextField(); wkF.setBounds(160,45,30,20); p2.add(wkF); mm = new JRadioButton("Number of Month Plan"); mm.setBounds(10,70,150,20); p2.add(mm); mmF = new JTextField(); mmF.setBounds(160,70,30,20); p2.add(mmF); yy = new JRadioButton("Year Plan"); yy.setBounds(10,90,100,20); p2.add(yy); yyF = new JTextField(); yyF.setBounds(90,90,30,20); p2.add(yyF); group = new ButtonGroup(); group.add(dd); group.add(wk); group.add(mm); group.add(yy); JPanel p3 = new JPanel(); p3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"",TitledBorder.CENTER,TitledBorder.TOP)); p3.setPreferredSize(new Dimension(150,105)); p3.setLayout(null); addweight = new JRadioButton("Add Weight Diet"); addweight.setBounds(5,15,120,15); p3.add(addweight); lossweight = new JRadioButton("Loss Weight Diet"); lossweight.setBounds(5,35,140,15); p3.add(lossweight); stress = new JRadioButton("Manage Stress Diet"); stress.setBounds(5,55,140,15); p3.add(stress); diabietic = new JRadioButton("Diabietics Diet"); diabietic.setBounds(5,75,140,15); p3.add(diabietic); gn = new JRadioButton("General Food"); gn.setBounds(5,95,140,15); p3.add(gn); group1 = new ButtonGroup(); group1.add(addweight); group1.add(lossweight); group1.add(stress); group1.add(diabietic); group1.add(gn); JPanel pan = new JPanel(); GroupLayout layout = new GroupLayout(pan); layout.setAutoCreateGaps(true); layout.setAutoCreateContainerGaps(true); pan.setLayout(layout); layout.setHorizontalGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(p2) ) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED,GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(p3) ) ); layout.setVerticalGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(p2) .addComponent(p3) ) ); JPanel okpanel = new JPanel(); okpanel.setPreferredSize(new Dimension(200,30)); okpanel.setLayout(null); ok = new JButton("OK"); ok.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); ok.setRolloverEnabled(false); ok.setBounds(150,0,60,20); ok.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ //if(dd.isSelected() ) //System.out.println(ddF.getText()+" Day" ); //new FoodFrame(); //ff.southPanel(currentamountfield.setText(infield.getText())); } }); okpanel.add(ok); JPanel container = new JPanel(); container.setPreferredSize(new Dimension(420,290)); GroupLayout lyn = new GroupLayout(container); container.setLayout(lyn); lyn.setAutoCreateGaps(true); lyn.setAutoCreateContainerGaps(true); lyn.setHorizontalGroup(lyn.createSequentialGroup() .addGroup(lyn.createParallelGroup(GroupLayout.Alignment.LEADING) .addComponent(p1) .addComponent(pan) .addComponent(okpanel) ) ); lyn.setVerticalGroup(lyn.createSequentialGroup() .addGroup(lyn.createParallelGroup(GroupLayout.Alignment.LEADING) .addGroup(lyn.createSequentialGroup() .addGroup(lyn.createParallelGroup(GroupLayout.Alignment.BASELINE) .addComponent(p1) ) .addComponent(pan) .addComponent(okpanel) ) ) ); add(container); setSize(420,290); setLocationRelativeTo(f); toFront(); setVisible(true); //setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); } /*public void itemStateChanged(ItemEvent e){ if(dd.isSelected() ) System.out.println(ddF.getText()+" Day" ); } public static void main(String[] arg){ SwingUtilities.invokeLater(new Runnable(){ public void run(){ new InputDialog().setVisible(true); } }); }*/ }
VIEWS ON THIS POST

49

Posted on:

Monday 22nd October 2012
View Replies!

How to embeded C++ GUI onto a Swing application?

We have an existing windows UI application which contains an OpenGL image viewer. We are thinking about rewrite the UI application by using Swing except the C++ OpenGL image viewer. I am wondering how to integrate the existing C++ OpenGL image viewer with the new Swing UI. I have no problem to use JNI call C++ methods but I have no experience on put a C++ window inside a Java panel. Can anybody help me Ideas, links and sample program all will be appreciated.
VIEWS ON THIS POST

38

Posted on:

Monday 22nd October 2012
View Replies!

how to use JSON in Swings application?

Can anybody please tell me how to use "JSON" in Swing Application (If possible with example/URL). Thank you. Pras
VIEWS ON THIS POST

45

Posted on:

Monday 22nd October 2012
View Replies!

Books on GUI applications architecture

Hi . I recently started developing an application using Java and SWT. I'm happy with the progress, but the GUI related code is getting to messy. It just seems that there is a lot of state information to pass around, even for the simplest operations. For example, something as simple as opening a window carries with it a lot of state information, because depending on the way the window was opened, different widgets should be initialized in different ways. I find myself using temp variables to hold initialization values, which easily can be misused, if I forget to set or reset them. This is just one example, there are other issues I come across regularly. So, I'd like to ask the GUI gurus around for some books or web articles that help in designing good architectures for GUI applications. Preferrably, please list practical books/articles with real code. I deal better with examples than purely theoretical concepts (I prefer to study these after having some practical grasp of the subject).
VIEWS ON THIS POST

59

Posted on:

Tuesday 23rd October 2012
View Replies!

Need help on design of Swing application

, I'm having a problem here with the design of my Swing app. It is a typical application with a JTree for navigation on the left, and a screen on the right. Each node in the tree implements an interface with the method JPanel getScreen(), so I'm able to set the screen on the right with the correct screen when selected. This way I can add any node with an own screen to the navigation tree. Because I want to keep View and Model separated, each Node in the tree contains a DataObject. Lets say my application displays files and directories, then I have a DirectoryNode containing a DirectoryDAO, and a FileNode containing a FileDAO. When a node is clicked, details of the object belonging to it are shown in the screen on right. looks good to me so far. I have a lot of different types of DataObjects displayed in my application. However my problem is that I've several objects that must be available for all of them. For example, because I want to be able to show modal dialogs, I need to have the top level JFrame available for each node. Also, because I must be able to add and remove nodes, I must be able to access the navigation tree from any node. Those are the View objects that must be available. Also, my DataObjects are nested. Like with Directories and Files, each File or Directory must be able to access the properties of its parent directories. Those are the Model objects that must be available to the child DataObjects. I've been trying to implement this using a "Context" object which I'm passing to the constructor of any child node added to the tree. Context just contains the JFrame, the Tree, and the parent DataObject. Any new DataObject in the tree just adds itself to the Context and passes the context to its children. However this is a far from perfect solution. 1. First of all, Model and View are mixed in my Context object, which I don't want. 2. Secondly, not all properties of Context can be final because after creation they must be set by the child data objects. This means they can be null, or set with wrong values. I really don't know how to handle this, and my whole beautiful application gets messed up right now. Does anyone have some suggestions for me how to solve this Thank you very, very much. [ June 21, 2005: Message edited by: Grub de Bliek ]
VIEWS ON THIS POST

53

Posted on:

Tuesday 23rd October 2012
View Replies!

Some suggestions about my application

Ranchers,I'm now working at a NMS system.I'll be responsible for all the GUI.Let me describle my designing.Would you shed some light on me First,the client almost runs at windows,so I'll use JGoodies's look and feel for windows. Then, for Layout,I don't choose third party layout.Because I think the layouts in JFC are all I need. I'll obey some guidelins to make it great. For the component,I'll do it by myself. What do you think of my dsign Any suggsetion will be appreciated.
VIEWS ON THIS POST

56

Posted on:

Tuesday 23rd October 2012
View Replies!

urgent help

hi im a portuguese student, i doing a project to finish university, but i've a short time to do it, my project must done in june, and im not work well withJAVA. I tell you what is my project, and if you help me, i will very gratefull to you. MY PROJECT: I have to do a "BUSINESS CASE TABLE", for my project ive create the "business case table" in 2 parts the first part is the variable names and the 2 part is the task names, this is ready but, ive a problem, the variables names are input from the user and if the variable name is too long i want that the header show multiple lines, i just do that, but is the next variable name is short the next column have a smaller header than the 1 column. My 2nd problem is in 2nd part, task names, i have create a table, in each cell of the table appear a combobox, this combobox have 2 images, when i click in the combobox is show me 2 images but when i choose one option the image dissapear and in the cell only show the name of the image. I want to know if anyone can help me\t I send you the complete code of my project.
VIEWS ON THIS POST

59

Posted on:

Tuesday 23rd October 2012
View Replies!