• 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

    • Dragon's Dogma 2: Dark Arisen expansion to bring snowy region, new updates also coming by Pulasthi Ariyasinghe Capcom had a surprise waiting for Dragon's Dogma fans today in the Nintendo Direct presentation. The company revealed an expansion for the second installment with a name that should be familiar to series veterans. Coming later this year, Dragon's Dogma 2: Dark Arisen is promising a massive new region to explore, new monsters, fresh skills to learn, and more. The studio says players will be heading to the Northern region of the world, named Norgan, to find new secrets about an undying "Fallen Dragon." There will be forgotten relics that the protagonist can find to unlock fresh weapons and skills the expansion is introducing. Players will also be able to find mysterious equipment from a previous Arisen as a part of the expansion, all part of 12 Lost Rites Dungeon Challenges they must complete to gain access. In Neowin's own review, I found Dragon's Dogma 2 to be an impressive RPG when it launched back in 2024, giving the title an 8.5/10 for its class variants, companion system, and immersive exploration. "Once a prosperous region of the kingdom of Vermund, it was abandoned many years ago for reasons unknown," says Capcom about the new region. "Long has it been since any soul traveled its paths. Blanketed in heavy snow, these frigid lands are home to savage hordes and creatures of unbelievable power. Those who are capable of vanquishing such fearsome foes, or those who possess a keen eye for exploration, will find themselves rewarded with powerful relics." Dragon’s Dogma 2: Dark Arisen expansion launches on October 9, 2026, with a $29.99 price tag. Ahead of the expansion release, Capcom is also planning to release two free updates to the base game. The first will land tomorrow, June 10, bringing more accessible fast travel with an Eternal Ferrystone and other quality-of-life adjustments. The second update will land sometime in August, aiming to improve frame rates, add more save slots, and bring even more community-requested adjustments. This expanded Dark Arisen edition is also launching on the Nintendo Switch 2 on the same day the content comes to PC, Xbox Series X|S, and PlayStation 5.
    • Classic themes are just the colors on the bar like the olden days, if you use the image themes, it does fancy transparent backgrounds and it makes the elements of the app look like they are transparent bubbles. This sample image shows what it looks like.  
    • Good point, unfortunately. NextDNS has far more filters and workarounds than uBlock, and it's easy to implement.
  • Recent Achievements

    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
    • One Year In
      jojodbn earned a badge
      One Year In
    • One Month Later
      jojodbn earned a badge
      One Month Later
    • Week One Done
      jojodbn earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      524
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      124
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      83
  • Tell a friend

    Love Neowin? Tell a friend!