• 0

design help?


Question

I am trying to make my chat program all snazzy ... but I suck at it ... I a horrible it is awful I want to cry it looks like that... it has an interface not even a mother could love ....

so basically i need help with gui programming.... look what happens when i try .... an links or tips or anything


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
@SuppressWarnings("unused")
public class SwingChatGUI extends JFrame
{
/**
*
*/
private static final long serialVersionUID = 1L;
public JButton sendButton;
public static JTextArea txArea;
public static JTextArea rxArea;

public Container container;

public JPanel n1, s1, w1, all;


public SwingChatGUI (String title)
{
super (title);

container = getContentPane();
container.setLayout( new BorderLayout() );
container.setPreferredSize(new Dimension(600, 600));
all = new JPanel(new BorderLayout());
container.add(all, BorderLayout.CENTER);

n1 = new JPanel(new BorderLayout());
n1.setPreferredSize(new Dimension(400, 200));
n1.setBorder(BorderFactory.createLineBorder(Color.black));
all.add(n1, BorderLayout.NORTH);

s1 = new JPanel(new BorderLayout());
s1.setPreferredSize(new Dimension(400, 200));
s1.setBorder(BorderFactory.createLineBorder(Color.black));
all.add(s1, BorderLayout.CENTER);


w1 = new JPanel(new BorderLayout());
w1.setPreferredSize(new Dimension(50, 400));
w1.setBorder(BorderFactory.createLineBorder(Color.black));
container.add(w1, BorderLayout.EAST);


txArea = new JTextArea (6, 40);
txArea.setLineWrap(true);
txArea.setWrapStyleWord(true);

rxArea = new JTextArea (6, 40);
rxArea.setLineWrap(true);
rxArea.setWrapStyleWord(true);

sendButton = new JButton ("Send");
sendButton.setPreferredSize(new Dimension(10, 20));
setResizable(false);

n1.add (rxArea);
s1.add (txArea);
w1.add (sendButton);

}


public static void main (String[] args)
{
Frame f = new SwingChatGUI ("Chat Program");
f.pack ();
f.setVisible(true);
}
}
[/CODE]

Link to comment
https://www.neowin.net/forum/topic/1126624-design-help/
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Do you expect someone else to compile and run this code, understand what it does, guess what your intent is and what isn't working out with it for you, and by sheer intuition come up with just the advice you need?

Perhaps you should at least explain what you're trying to do and what the problem is, in more detail than "it sucks". And if it's a visual issue, perhaps you could even a post a screenshot illustrating what the issue is. The less work and guessing you force us to do, the more quickly you'll get a quick and informative answer.

Link to comment
https://www.neowin.net/forum/topic/1126624-design-help/#findComment-595404228
Share on other sites

  • 0

Consider using NetBeans built-in GUI Builder for drag-and-drop Swing development. Eclipse has a similar plugin, but I find myself more productive in NetBeans. Your mileage may vary.

?? does eclipse have this plugin ? I would rather code it in my self but this whole panel panel panel panel panel ENDLESS PANELS is getting to me a bit ..

Link to comment
https://www.neowin.net/forum/topic/1126624-design-help/#findComment-595410390
Share on other sites

  • 0

Although be very wary when using GUI builders for Java. They more often than not produce buckets of horrible code that quickly becomes a maintenance nightmare somewhere along the road. Use them with care.

Yeah, I think doing it via XML is a cleaner way to design a GUI: http://java-source.net/open-source/xml-user-interface-toolkits

Link to comment
https://www.neowin.net/forum/topic/1126624-design-help/#findComment-595411854
Share on other sites

This topic is now closed to further replies.
  • Posts

    • HomeBank 5.10.1 by Razvan Serea HomeBank is a free software (as in "free speech" and also as in "free beer") that will assist you to manage your personal accounting. It is designed to easy to use and be able to analyse your personal finance and budget in detail using powerful filtering tools and beautiful charts. If you are looking for a completely free and easy application to manage your personal accounting, budget, finance then HomeBank should be the software of choice. HomeBank also benefits of more than 19 years of user experience and feedback, and is translated by its users in around 56 languages. Highlights: Cross platform, supports GNU/Linux, Microsoft Windows, Mac OS X Import easily from Intuit Quicken, Microsoft Money or other software Import bank account statements (OFX, QIF, CSV, QFX) Duplicate transaction detection Automatic cheque numbering Various account types : Bank, Cash, Asset, Credit card, Liability Scheduled transaction Category split Internal transfer Month/Annual budget Dynamic powerful reports with charts Automatic category/payee assignment Vehicule cost HomeBank 5.10.1 changelog: change: the input field helper icon + fixed some spacing inconsistency change: transaction, added some missing input tooltips and reworked existing change: category, payee and tag window add input now have a tooltip and button change: split window, refactored the layout change: split window, add display of memo and date wish : #2106800 budget report option to exclude transfers from unbudgeted line bugfix: prevent deletion of non pending transaction when rejecting bugfix: transaction warning for no rate faultly showing in transfer bugfix: report missing space for filter tooltip icon bugfix: budget report missing filter tooltip bugfix: manage account closed icon was hidding budget icon bugfix: #2154771 view transcations requires hitting Escape or X twice to close dialog bugfix: #2154337 transfer to/from closed account with different currency don't show the amount bugfix: #2154234 scheduled transaction recurring pattern daily value limited to 100 bugfix: #2149897 view split for closed accounts bugfix: #2148561 global time chart do not shows current period by default bugfix: #2148456 the main screen Total Chart is no longer showing an overall total bugfix: #2147497 editing a transaction resets scroll position bugfix: #2147377 balance mixup with transaction same day sort by amount bugfix: #2147052 quarter are wrong when fiscal year is jan 1 bugfix: #2147048 all events for the month are late but today is only the 1st bugfix: #2144993 impossible to search for transactions by value for values >999,99 bugfix: #2144698 adding new Category/Payee/Tags requires hitting -Enter- bugfix: #2144419 QIF Account name detection fail on import bugfix: #2142349 can't delete account groups bugfix: #2139409 account maximum limit is not fully used (example credit card) bugfix: #2133783 transfers shouldn't add to dashboard top spending reports Download: HomeBank 5.10.1 | 20.5 MB (Open Source) Download: 3rd party packages (macOSX. Ubuntu...etc) View: HomeBank Website | Support | Features | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Same, price was right for my Home, laptop, phone. Works great!
    • Brave and Firefox. I’ve been using them as my primary browsers for a while now, perfect combo
    • They want Ring 0 access. Should be a hard no. A middle ground needs to be found.
  • Recent Achievements

    • One Year In
      Primer1st earned a badge
      One Year In
    • Experienced
      JayZJay went up a rank
      Experienced
    • Reacting Well
      Sir_Timbit earned a badge
      Reacting Well
    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      524
    2. 2
      PsYcHoKiLLa
      232
    3. 3
      Edouard
      135
    4. 4
      ATLien_0
      88
    5. 5
      Steven P.
      83
  • Tell a friend

    Love Neowin? Tell a friend!