TABS and HOW to USE them

does anyone know how to make basic tabs?
[47 byte] By [hello.everyonea] at [2007-11-27 6:39:12]
# 1
\ t
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 2
oh hey how are you doing?
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 3
im tired.
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 4
oh..i scraped some of my other idea for now im into tabs
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 5
have u ever used them?
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 6
awesome. thats solid. real maxed out turbo.
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 7
huh?
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 8
have i used tabs? no way. you put them on your tongue and they make you crazy. real berkeley. you know what i mean.
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 9
so how are you doing? doing alright?
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 10
oh lol so i guess ur the master with tabs think u can show me how to mak one basic one?
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 11
yeah im doing good thanks
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 12
do you have any stamps?
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 13
y?
hello.everyonea at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 14
yea youre right. things are getting crazy in here.
TuringPesta at 2007-7-12 18:08:15 > top of Java-index,Java Essentials,New To Java...
# 15

It would be easier to answer your questions if you weren't insane.

Tabs are just characters. You represent the tab with the "\t" escape. For example, this prints a tab to standard output:

System.out.print("\t");

However, that code is pretty much worthless. Your question is about something so trivial that you're either completely incompetent, or more likely, you're not describing your actual issue very well.

Tabs are used to make columned output on a plain terminal, or as a possible separator between fields in a textual data file. In the olden days, back when I was using Perl 4, we used tabs a lot to make data structures beyond that which Perl4 could otherwise easily handle, but Perl5 has made that unnecessary. You don't use tabs a whole lot in Java because you have much better ways to create complex data structures, and you tend not to use tab-delimited files much in Java, although I suppose it happens occasionally.

paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 16
lmao yup...so will u help me with tabs please?
hello.everyonea at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 17
who's that paul guy? you wanna hang out?
TuringPesta at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 18
that paul guy keeps talking about pearls. you ever go to the beach?
TuringPesta at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 19
all i want is a tab bar with 1 tab on it lol
hello.everyonea at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 20
@hello.everyone: I have already given you all the help with tabs that you can plausibly need, at least with the question as you have stated it.@TuringPest: Sure, dude. Beats working.
paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 21
i know a good bar too. you ever try shasta? its better than tabs i think.
TuringPesta at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 22
> all i want is a tab bar with 1 tab on it lolDo you mean you want a GUI widget that displays multiple screens of information, in which the user selects the screen by selecting a tab from one or more rows of tabs?
paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 23
Do they sell Shasta outside of California?
paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 24
paul youre a cool guy. but stop trying to hypnotize me.
TuringPesta at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 25
You are getting sleepy.
paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 26
yes that exactly what i want
hello.everyonea at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 27
tabs are a real pane.
TuringPesta at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 28
do u have any old coding wih it?
hello.everyonea at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 29

Then that's what you should have asked, instead of wasting everyone's time with vagueness.

Also you should probably have asked on a forum about GUIs, like the Swing forum.

There's a Swing widget called JTabbedPane. Here's a tutorial:

http://java.sun.com/docs/books/tutorial/uiswing/components/tabbedpane.html

Any further questions about that class should be asked on the Swing forum.

May I also suggest waiting until the drugs wear off before trying to program again.

paulcwa at 2007-7-21 22:01:16 > top of Java-index,Java Essentials,New To Java...
# 30
yea
TuringPesta at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 31
you can put the stamps on the screen. you know?
TuringPesta at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 32
i dont no how
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 33
can u right me a simple tab code
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 34
Read the f'in' tutorial.
paulcwa at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 35
i dont get it
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 36

System.out.print(Tabs.getTab());

other class called Tab

public static String getTab() {

return getOtherTab();

}

private static String getOtherTab() {

return getOtherOtherTab();

}

private static String getOtherOtherTab() {

return "\t";

}

lethalwirea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 37
TuringPest, are you alright?
CaptainMorgan08a at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 38
> i dont get itD'oh!
CaptainMorgan08a at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 39
im fairly new to java that stuff means nothing to me
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 40
can someone just give me the real code for tabbed pane and then if u guys need anything im here for u guys please and most appreciated thankyou
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 41
> im fairly new to java that stuff means nothing to meWell then it sounds like you need to start at the beginning. http://java.sun.com/docs/books/tutorial/getStarted/index.html
CaptainMorgan08a at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 42
not that new lmao
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 43
> can someone just give me the real code for tabbed> pane and then if u guys need anything im here for u> guys please and most appreciated thankyouOOOOOOOOOOOOOOHHH......You wanted help with a tabbed PANE...Well why didn't you say so?
CaptainMorgan08a at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 44
what did u think i needed help with lmao sry bro
hello.everyonea at 2007-7-21 22:01:21 > top of Java-index,Java Essentials,New To Java...
# 45
> what did u think i needed help with lmao sry broIt seems that TuringPest, Paul, and I all thought you were talking about the tab character.
CaptainMorgan08a at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 46
lmao not im not talking about my tab key on my keyboard lmao
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 47

public class new2 extends JPanel {

public new2() {

setLayout(new BorderLayout());

JTabbedPane tabbedPane = new JTabbedPane();

String tabs[] = { "One" };

for (int i = 0; i < tabs.length; i++) {

tabbedPane.addTab(tabs[i], createPane(tabs[i]));

}

add(tabbedPane, BorderLayout.CENTER);

}

JPanel createPane(String s) {

JPanel p = new JPanel();

return p;

}

public static void main(String[] args) {

JFrame frame = new JFrame("");

frame.addWindowListener(new WindowAdapter() {

{

}

});

frame.getContentPane().add(new new2());

frame.setSize(200, 100);

frame.setVisible(true);

}

}

hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 48
i made that but it has no content pane so i cant add things to it
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 49
do u no how i can put buttons and stuff on that page?
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 50
you guys are real chill. you wanna jam?
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 51
i have buttons from every state. what kind of buttons do you have?
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 52
i have 2 days to finish this project wil someone please help me out?
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 53
> It seems that TuringPest, Paul, and I all thought you were talking about the tab character.are you the captain of a ship? i said tabs are a pane. i think that was foreshadowing. you know taoism?
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 54
i will. youre like a brother to me.
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 55
please someone help
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 56
i am typing now.
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 57

It appears that you can add any kind of component you like to a tabbed pane's internal panels. So if you want to add a single button, then add a button. If you want to add multiple things to a single tabbed pane's internal panel, then create and add a panel and then add things to that panel.

Anyway, didn't I tell you to ask on the Swing forum?

paulcwa at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 58
paul, we learn more from asking not telling.
TuringPesta at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 59
more help is here
hello.everyonea at 2007-7-21 22:01:26 > top of Java-index,Java Essentials,New To Java...
# 60
> i have 2 days to finish this project wil someone> please help me out?You're getting far more help than you deserve. You're barely putting any effort into this at all, apparently.
paulcwa at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 61
h.e that was very profound.
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 62
cuz there not helping me alot there saying things like butons from each state
hello.everyonea at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 63
what is the state of where you are putting the buttons. answer me this.
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 64

You're not even putting in the effort to form complete sentences, to spell words out entirely ("cuz" != "because") or to choose the correct words among homonyms ("there" != "they're").

Anyway, here's a simple example I was able to throw together in a couple minutes using the amazing technique of reading the f'*** documentation.

import javax.swing.*;

public class TestTabbedPane {

public static void main(String[] argv) {

JFrame f = new JFrame();

JTabbedPane jtp = new JTabbedPane();

f.getContentPane().add(jtp);

jtp.add("Monkey", new JLabel("bobo"));

jtp.add("Horse", new JLabel("man'o'war"));

JPanel m = new JPanel();

jtp.add("Other", m);

m.add(new JLabel("label number one"));

m.add(new JLabel("label number two"));

f.pack();

f.setVisible(true);

}

}

Does that help, lazy-bones?

paulcwa at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 65
ur really annoying
hello.everyonea at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 66
you need a hug man. im sad my brother is in this mindset.
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 67
> ur really annoyingYou were already told to read the tutorial on JTabbedPane's and to post in the Swing forum. You failed to follow both of those.
CaptainMorgan08a at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 68
yea but what happens when we follow someone who fails? this is worse.
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 69
> you need a hug man...Dude, I think you need to lay off the acid. ;-)
CaptainMorgan08a at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 70
the day you quit the sea
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 71
I thank you very much for helping me.
hello.everyonea at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 72
border1.setForeground(Color.cyan);
hello.everyonea at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 73
cannot find symbol method setForeground(java.awt.Color)
hello.everyonea at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 74
thats a fact
TuringPesta at 2007-7-21 22:01:31 > top of Java-index,Java Essentials,New To Java...
# 75
[url= http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JComponent.html#setForeground(java.awt.Color)]relevant?[/url]
TuringPesta at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 76
its like we're a day older.
TuringPesta at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 77
> thats a factGeneral Barnicke: Are you telling me that you men finished your training on your own?John Winger: That's a fact, Jack.Soldiers: That's a fact, Jack.
filestreama at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 78
ill help you, please provide your full name, and the name of the course, name of the professor so i may put it in header comments.i think i should be able to do it in under an hour, please respond fast
mkoryaka at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 79
My name is Henry Krinkle. K-R-l-N-K-L-E. Hopper Avenue. You know, like a rabbit. Hip, hop.
TuringPesta at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 80
> My name is Henry Krinkle. K-R-l-N-K-L-E. Hopper> Avenue. You know, like a rabbit. Hip, hop.You talkin' to me? You talkin' to me?
kevjavaa at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...
# 81
you aint never had no chicken like that.
TuringPesta at 2007-7-21 22:01:36 > top of Java-index,Java Essentials,New To Java...