• 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

    • JetBrains is working to cut false positives in RustRover 2026.2 by David Uzondu Recently, JetBrains released the fifth EAP build of its dedicated IDE, RustRover 2026.2, bringing improvements like a Run gutter icon for criterion_main! macro benchmarking and a feature that alerts you when there are unused traits in your current scope. Now, the company is out with a blog post addressing one of the "most common" complaints from users: false positives. In RustRover, a false positive occurs when the editor incorrectly highlights something as an error even though the project compiles and runs successfully. This mismatch flags a gap between the IDE's internal intelligence and the actual compiler. When the editor flashes red warnings over perfectly valid code, developers lose trust in the tool, which stalls momentum. Traditionally, RustRover runs cargo check to detect compiler errors and warnings, but it also relies on its own code analysis engine to power real-time features. To provide quick feedback, this engine parses your source code into a syntax tree while inferring types and resolving names as you type. Because this engine must work on broken, half-written code and react instantly, its logic sometimes diverges from the compiler's, producing false positives that do not exist in the compiler's eyes. JetBrains said that it has a "dedicated task force" focused specifically on identifying and fixing false positives by analyzing user reports and examining large-scale open-source projects. To speed up this process, the team built an internal system modeled after Crater, the famous Rust project that compiles and runs tests for every single crate published on crates.io. This automated pipeline compares the diagnostics from RustRover's analysis with actual compiler output to catch discrepancies before they reach users, ensuring smoother workflows. RustRover, for those who're unaware, is a dedicated IDE designed specifically for Rust developers. It's been around for a couple of years now, providing features like built-in debugging via LLDB, seamless cargo integration, advanced macro expansion, and HTML support. JetBrains distributes the app under two licensing models: a paid commercial subscription and a free option for non-commercial use.
    • Last year I bought the 2TB variant for $114 on Amazon. That's crazy that the 1TB is now 67% more expensive for half the storage, even with the newer T9 already on the market. And that's considered a good deal.
    • You can disable all non needed features from Brave. There is also Brave Origin which removes them entirely and it is free for Linux.
    • I wish I could use Brave but the tab suspension feature is horrible. It doesn't suspend them like Edge does. Even after 2h open with 70+ tabs (same as Edge), it has 2GB more consumption than Edge for no reason.
    • TeamViewer 15.78.4.0 by Razvan Serea TeamViewer is the fast, simple and friendly solution for remote access over the Internet - all applications in one single, very affordable module. Remote control of computers over the Internet, Instantly take control over a computer anywhere on the Internet, even through firewalls. No installation required, just use it fast and secure. Training, sales and teamwork, TeamViewer can also be used to present your desktop to a partner on the Internet. Show and share your software, PowerPoint presentations etc. File transfer, chat and more, Share your files, chat, switch the direction during a teamwork session, and a lot more is included in TeamViewer. TeamViewer key features: Cross-platform remote access (Windows, macOS, Linux, Android, iOS, IoT) Attended and unattended remote control Secure file transfer between devices Remote printing to local printers Multi-monitor support with easy switching Wake-on-LAN for sleeping devices Session links for quick connections (no password sharing) Web client access (no installation needed) End-to-end encryption (AES-256) Two-factor authentication and access controls AI-powered session insights and reporting Mass deployment and device management tools Customizable allow/block lists for security Command line and script execution remotely Performance monitoring and analytics dashboards TeamViewer 15.78.4.0 changelog: Improvements Permissions inheritance has been improved, increasing reliability when permissions are assigned to user group managers. Bugfixes Fixed a bug where 'Show details' button was not showing up on command bar upon selection of a device group. Fixed a bug which was causing the legacy groups to disappear when applying hide offline filter in basic view. Fixed a bug where devices were loading infinitely after login. Fixed a bug which was causing crash in application. Download: TeamViewer 15.78.4.0 | 32-bit | Portable | Mac | ~70.0 MB (Free for personal use) View: TeamViewer Home Page | Release Notes | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • 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
      517
    2. 2
      PsYcHoKiLLa
      229
    3. 3
      Edouard
      135
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      82
  • Tell a friend

    Love Neowin? Tell a friend!